summaryrefslogtreecommitdiff
path: root/vm_sync.c
Commit message (Collapse)AuthorAgeFilesLines
* Move RB_VM_SAVE_MACHINE_CONTEXT to internal/thread.hMatt Valentine-House2023-03-151-0/+1
|
* Rename RB_GC_SAVE_MACHINE_CONTEXT -> RB_VM_SAVE_MACHINE_CONTEXTMatt Valentine-House2023-03-151-1/+1
|
* Stop exporting symbols for MJITTakashi Kokubun2023-03-061-4/+4
|
* Merge gc.h and internal/gc.hMatt Valentine-House2023-02-091-1/+1
| | | | [Feature #19425]
* Fix format specifier for `rb_ractor_id()`Nobuyoshi Nakada2022-07-281-2/+4
|
* Prefix ccan headers (#4568)Nobuyoshi Nakada2022-03-301-2/+2
| | | | | | | | | | | | | * Prefixed ccan headers * Remove unprefixed names in ccan/build_assert * Remove unprefixed names in ccan/check_type * Remove unprefixed names in ccan/container_of * Remove unprefixed names in ccan/list Co-authored-by: Samuel Williams <samuel.williams@oriontransfer.co.nz>
* Supress `warning: data argument not used by format string [-Wformat-extra-args]`Kazuhiro NISHIYAMA2021-10-201-3/+3
|
* Fixed leaked global symbolsNobuyoshi Nakada2020-12-261-2/+2
|
* separate rb_ractor_pub from rb_ractor_tKoichi Sasada2020-12-221-1/+1
| | | | | | | | | separate some fields from rb_ractor_t to rb_ractor_pub and put it at the beggining of rb_ractor_t and declare it in vm_core.h so vm_core.h can access rb_ractor_pub fields. Now rb_ec_ractor_hooks() is a complete inline function and no MJIT related issue.
* add vm_sync debug countersKoichi Sasada2020-12-161-0/+2
| | | | | | | | * vm_sync_lock * vm_sync_lock_enter * vm_sync_lock_enter_nb * vm_sync_lock_enter_cr * vm_sync_barrier
* re-layout rb_ractor_tKoichi Sasada2020-12-091-1/+1
| | | | separate synchronization data and ractor local data.
* RB_VM_LOCK_ENTER_NO_BARRIERKoichi Sasada2020-12-071-42/+56
| | | | | | | | | 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.
* log for the beggining of vm_lock_enterKoichi Sasada2020-12-071-0/+2
| | | | Before this patch, there is no information to start locking.
* RB_VM_LOCK_ENTER_CR_LEVKoichi Sasada2020-12-071-4/+16
| | | | | This is variant of RB_VM_LOCK_ENTER_LEV, but accept current racotr's pointer.
* fix public interfaceKoichi Sasada2020-11-181-1/+1
| | | | | | | | | | | | | | | | | | To make some kind of Ractor related extensions, some functions should be exposed. * include/ruby/thread_native.h * rb_native_mutex_* * rb_native_cond_* * include/ruby/ractor.h * RB_OBJ_SHAREABLE_P(obj) * rb_ractor_shareable_p(obj) * rb_ractor_std*() * rb_cRactor and rm ractor_pub.h and rename srcdir/ractor.h to srcdir/ractor_core.h (to avoid conflict with include/ruby/ractor.h)
* sync RClass::ext::iv_index_tblKoichi Sasada2020-10-171-2/+2
| | | | | | | | | | | | iv_index_tbl manages instance variable indexes (ID -> index). This data structure should be synchronized with other ractors so introduce some VM locks. This patch also introduced atomic ivar cache used by set/getinlinecache instructions. To make updating ivar cache (IVC), we changed iv_index_tbl data structure to manage (ID -> entry) and an entry points serial and index. IVC points to this entry so that cache update becomes atomically.
* fix releasing timing.Koichi Sasada2020-10-141-11/+10
| | | | | | | (1) recorded_lock_rec > current_lock_rec should not be occurred on rb_ec_vm_lock_rec_release(). (2) should be release VM lock at EXEC_TAG(), not POP_TAG(). (3) some refactoring.
* support exception when lock_rec > 0Koichi Sasada2020-10-141-0/+22
| | | | | | If a ractor getting a VM lock (monitor) raises an exception, unlock can be skipped. To release VM lock correctly on exception (or other jumps with JUMP_TAG), EC_POP_TAG() releases VM lock.
* relax dependencyKoichi Sasada2020-09-151-3/+1
| | | | vm_sync.h does not need to include vm_core.h and ractor_pub.h.
* Initialize loop variables of list_for_each for MS VCNobuyoshi Nakada2020-09-041-1/+1
|
* Introduce Ractor mechanism for parallel executionKoichi Sasada2020-09-031-0/+250
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.