From: "chrisseaton (Chris Seaton)" Date: 2022-07-25T14:22:31+00:00 Subject: [ruby-core:109316] [Ruby master Feature#12607] Ruby needs an atomic integer Issue #12607 has been updated by chrisseaton (Chris Seaton). Yes, I think a few low-level concurrency primitives should move from Concurrent Ruby to core. As we add more concurrency to Ruby, and add JIT compilers, ideally the VM should understand these primitives, rather than being opaque extension code. ---------------------------------------- Feature #12607: Ruby needs an atomic integer https://bugs.ruby-lang.org/issues/12607#change-98454 * Author: shyouhei (Shyouhei Urabe) * Status: Feedback * Priority: Normal * Assignee: ko1 (Koichi Sasada) ---------------------------------------- (This one was derived from bug #12463) Although I don't think += would become atomic, at the same time I understand Rodrigo's needs of _easier_ counter variable that resists inter-thread tampering. I don't think ruby's Integer class can be used for that purpose for reasons (mainly because it is not designed with threads in mind). Rather we should introduce a integer class which is carefully designed. Why not import Concurrent::AtomicFixnum into core? -- https://bugs.ruby-lang.org/ Unsubscribe: