-
Notifications
You must be signed in to change notification settings - Fork 2
Description
More of a discussion than an issue, but should this functionality be merged in concurrent-ruby?
It seems about the same performance, so the main difference is that this gem supports Ractor and concurrent-ruby currently doesn't, is that correct?
As a concurrent-ruby maintainer, I think it would make sense to add this kind of Ractor support for Concurrent::Atomic{Boolean,Fixnum,Reference} (https://github.com/ruby-concurrency/concurrent-ruby?tab=readme-ov-file#thread-safe-value-objects-structures-and-collections).
However we'd need to know whether that Concurrent::AtomicReference is meant to be shared across Ractor or not, if yes we need to Ractor.make_shareable the value inside. If not we need to not make it shareable, as that is more restrictive and incompatible for existing usages with threads.
Maybe as an argument to Concurrent::AtomicReference.new or maybe as a subclass, or maybe a separate class?
For Concurrent::Atomic{Boolean,Fixnum} it's fine because those values are already shareable/immutable.