Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

What would be needed to also support a threadsafe Arc-like? #145

Open
dlight opened this issue Jan 27, 2023 · 3 comments
Open

What would be needed to also support a threadsafe Arc-like? #145

dlight opened this issue Jan 27, 2023 · 3 comments
Labels
A-std-compat Area: Compatibility with the latest from `Rc` in upstream `alloc` and `std`. C-enhancement Category: New feature or request. C-question Category: Further information is requested.

Comments

@dlight
Copy link

dlight commented Jan 27, 2023

I didn't find this in the docs so I thought about asking! Is cactusref's approach fundamentally incompatible with multithreading, or it's just that currently the implementation is focusing in single-threaded Rc?

@thefakeplace
Copy link

Also interested in this! Does the lib plan on implementing something like this?

@lopopolo lopopolo added C-enhancement Category: New feature or request. C-question Category: Further information is requested. labels Feb 2, 2023
@lopopolo
Copy link
Member

lopopolo commented Feb 2, 2023

Hey folks, thanks for reaching out and your interest in cactusref.

To start, yes, it should be doable to add an Arc equivalent to cactusref.

The existing cactusref::Rc and cactusref::Weak types are very heavily forked versions of alloc::rc::Rc and alloc::rc::Weak. The same approach in theory could be applied to std::sync::Arc.

There is an outstanding ticket to resync this repository's fork of alloc::rc with the upstream lib in rust-lang/rust:

That work is probably the first step needed to consider adding an Arc equivalent. Additionally, I'd like to get miri and leaksan running in CI and passing on the Rc types before considering adding an Arc type.

Apologies for the lack of activity in this repository, cactusref has not been a priority for me or for Artichoke since it is nightly-only and not relevant to the ongoing mruby oxidation work.

If any of y'all would like to take a stab at this, I'd be more than happy to mentor.

@lopopolo
Copy link
Member

lopopolo commented Feb 2, 2023

I cut a ticket for the leaksan work here if anyone wants to pick it up:

@lopopolo lopopolo added the A-std-compat Area: Compatibility with the latest from `Rc` in upstream `alloc` and `std`. label Feb 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-std-compat Area: Compatibility with the latest from `Rc` in upstream `alloc` and `std`. C-enhancement Category: New feature or request. C-question Category: Further information is requested.
Development

No branches or pull requests

3 participants