summaryrefslogtreecommitdiff
path: root/include/ruby/atomic.h
AgeCommit message (Collapse)Author
15 hoursReduce `Object#object_id` contention.Jean Boussier
If the object isn't shareable and already has a object_id we can access it without a lock. If we need to generate an ID, we may need to lock to find the child shape. We also generate the next `object_id` using atomics. Notes: Merged: https://github.com/ruby/ruby/pull/13298
2025-04-30get_next_shape_internal: Skip VM lock for single child caseJean Boussier
If the shape has only one child, we check it lock-free without compromising thread safety. I haven't computed hard data as to how often that it the case, but we can assume that it's not too rare for shapes to have a single child that is often requested, typically when freezing and object. Notes: Merged: https://github.com/ruby/ruby/pull/13191
2025-04-18Work on ATOMIC_VALUE_SETJohn Hawthorn
Notes: Merged: https://github.com/ruby/ruby/pull/12921
2024-11-02Include windows.h for `LONG` and `Interlocked` functionsNobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/11985
2024-06-07Cast `RUBY_ATOMIC_PTR_CAS` argumentsNobuyoshi Nakada
As well as `RUBY_ATOMIC_PTR_EXCHANGE` and `RUBY_ATOMIC_PTR_LOAD`.
2024-02-11Win32: Fix pre-defined macros for platformsNobuyoshi Nakada
Use `_WIN64` for word-size, `_M_AMD64` for CPU-specific feature.
2023-12-10Add RUBY_ATOMIC_{PTR_,}FETCH macros for atomic loadsKJ Tsanaktsidis
This can already be emulated by doing an atomic fetch_add of zero, but this is more explicit. [Bug #19994]
2021-09-24Align the implementation precedences with `rb_atomic_t` definitionNobuyoshi Nakada
On MinGW, where both of Win32 API and GCC built-ins are available, the mismatch of implementations to the definition caused lots of warnings.
2021-09-22include/ruby/atomic.h: rework卜部昌平
Reduce macros to do the same things in inline functions instead. This way assertions can be made granular. Notes: Merged: https://github.com/ruby/ruby/pull/4848
2021-09-15include/ruby/atomic.h: add doxygen卜部昌平
Must not be a bad idea to improve documents. [ci skip] Notes: Merged: https://github.com/ruby/ruby/pull/4835
2021-03-07Removed a typo in a comment [ci skip]Nobuyoshi Nakada
2020-12-24Use RBIMPL_COMPILER_{SINCE,BEFORE} for MSVCNobuyoshi Nakada
Pointed out by @shyouhei. NOTE: Already we have dropped the support for older MSVCs, probably prior to 1300 or 1400. Remove the conditional code, especially in win32/Makefile.sub.
2020-12-24Expose atomic operation macros with RUBY prefixNobuyoshi Nakada
Now we need atomic operations, which are lighter than mutex, more widely for extension libraries because of Ractor. Notes: Merged: https://github.com/ruby/ruby/pull/3983