summaryrefslogtreecommitdiff
path: root/vm_sync.h
AgeCommit message (Collapse)Author
2020-12-26Fixed leaked global symbolsNobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/4003
2020-12-16add vm_sync debug countersKoichi Sasada
* vm_sync_lock * vm_sync_lock_enter * vm_sync_lock_enter_nb * vm_sync_lock_enter_cr * vm_sync_barrier Notes: Merged: https://github.com/ruby/ruby/pull/3910
2020-12-07RB_VM_LOCK_ENTER_NO_BARRIERKoichi Sasada
Write barrier requires VM lock because it accesses VM global bitmap but RB_VM_LOCK_ENTER() can invoke GC because another ractor can wait to invoke GC and RB_VM_LOCK_ENTER() is barrier point. This means that before protecting by a write barrier, GC can invoke. To prevent such situation, RB_VM_LOCK_ENTER_NO_BARRIER() is introduced. This lock primitive does not become GC barrier points.
2020-12-07fix decl of ruby_single_main_ractorKoichi Sasada
On windows, MJIT doesn't work without this patch because of the declaration of ruby_single_main_ractor. This patch fix this issue and move the definition of it from ractor.c to vm.c to locate near place of ruby_current_vm_ptr. Notes: Merged: https://github.com/ruby/ruby/pull/3842
2020-12-07RB_VM_LOCK_ENTER_CR_LEVKoichi Sasada
This is variant of RB_VM_LOCK_ENTER_LEV, but accept current racotr's pointer. Notes: Merged: https://github.com/ruby/ruby/pull/3842
2020-12-07ruby_single_main_ractor for single ractor modeKoichi Sasada
ruby_multi_ractor was a flag that indicates the interpreter doesn't make any additional ractors (single ractor mode). Instead of boolean flag, ruby_single_main_ractor pointer is introduced which keeps main ractor's pointer if single ractor mode. If additional ractors are created, ruby_single_main_ractor becomes NULL. Notes: Merged: https://github.com/ruby/ruby/pull/3842
2020-10-14remove useless semicolonsKoichi Sasada
2020-09-15relax dependencyKoichi Sasada
vm_sync.h does not need to include vm_core.h and ractor_pub.h. Notes: Merged: https://github.com/ruby/ruby/pull/3534
2020-09-04check multi_ractor mode at main_pKoichi Sasada
rb_ractor_main_p() need to access to the ractor pointer in TLS. However it is slow operation so that we need to skip this check if it is not multi-ractor mode (!ruby_multi_ractor). This performance regression is pointed at https://bugs.ruby-lang.org/issues/17100#note-27 Notes: Merged: https://github.com/ruby/ruby/pull/3513
2020-09-03Introduce Ractor mechanism for parallel executionKoichi Sasada
This commit introduces Ractor mechanism to run Ruby program in parallel. See doc/ractor.md for more details about Ractor. See ticket [Feature #17100] to see the implementation details and discussions. [Feature #17100] This commit does not complete the implementation. You can find many bugs on using Ractor. Also the specification will be changed so that this feature is experimental. You will see a warning when you make the first Ractor with `Ractor.new`. I hope this feature can help programmers from thread-safety issues. Notes: Merged: https://github.com/ruby/ruby/pull/3365