Age | Commit message (Collapse) | Author |
|
https://github.com/ruby/ruby/actions/runs/4316423442/jobs/7532190115
http://ci.rvm.jp/results/trunk-yjit@ruby-sp2-docker/4466770
|
|
This reverts commit 9792d9e40f790e6deb18ead56a8befc9d5c4bc51.
Ractor implementation has been rewritten. Let's see if it works now.
|
|
It returns the waiting set is empty or not.
Also add Ractor::Selector's tests.
Notes:
Merged: https://github.com/ruby/ruby/pull/7417
|
|
I hope a4421bd73c286253311c2cdf8c78ed258f8cff44 will solve the issue...
Notes:
Merged: https://github.com/ruby/ruby/pull/7416
|
|
This patch rewrites Ractor synchronization mechanism, send/receive
and take/yield.
* API
* Ractor::Selector is introduced for lightweight waiting
for many ractors.
* Data structure
* remove `struct rb_ractor_waiting_list` and use
`struct rb_ractor_queue takers_queue` to manage takers.
* remove `rb_ractor_t::yield_atexit` and use
`rb_ractor_t::sync::will_basket::type` to check the will.
* add `rb_ractor_basket::p.take` to represent a taking ractor.
* Synchronization protocol
* For the Ractor local GC, `take` can not make a copy object
directly so ask to generate the copy from the yielding ractor.
* The following steps shows what `r1.take` does on `r0`.
* step1: (r0) register `r0` into `r1`'s takers.
* step2: (r0) check `r1`'s status and wakeup r0 if `r1` is waiting
for yielding a value.
* step3: (r0) sleep until `r1` wakes up `r0`.
* The following steps shows what `Ractor.yield(v)` on `r1`.
* step1: (r1) check first takers of `r1` and if there is (`r0`),
make a copy object of `v` and pass it to `r0` and
wakes up `r0`.
* step2: (r1) if there is no taker ractors, sleep until
another ractor try to take.
Notes:
Merged: https://github.com/ruby/ruby/pull/7371
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/7079
|
|
This reverts commit 650a20a3e1205f47224a987676cdbad7d826d597.
Now that 3.2.0 is released, let's disable flaky tests. Koichi said he'll
rework Ractor implementation for this, and it has not been done yet.
|
|
|
|
This would be still flaky, but we want to make sure there's no
YJIT-specific issue when Ruby 3.2 is released. We might skip it again
after the release.
|
|
This reduces global lock acquiring for reading.
https://bugs.ruby-lang.org/issues/18949
Notes:
Merged: https://github.com/ruby/ruby/pull/6935
|
|
|
|
|
|
Koichi plans to rework Ractor implementation to address these failures.
He agreed to skip flaky Ractor tests for now.
|
|
for consistency with YJIT
Notes:
Merged-By: k0kubun <[email protected]>
|
|
The internal location in ractor.rb is not usefull at all.
```
$ ruby -e 'Ractor.new {}'
<internal:ractor>:267: warning: Ractor is experimental, ...
```
Notes:
Merged: https://github.com/ruby/ruby/pull/6629
Merged-By: nobu <[email protected]>
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/6490
|
|
Class variables (@@cv) is not accessible from non-main ractors.
But without this patch cached @@cv can be read.
fix [Bug #18128]
Notes:
Merged: https://github.com/ruby/ruby/pull/5335
|
|
fix [Bug #18120]
Notes:
Merged: https://github.com/ruby/ruby/pull/5267
|
|
`Ractor.make_shareable(proc_obj)` raises an `IsolationError`
if the self of `proc_obj` is not a shareable object.
[Bug #18243]
Notes:
Merged: https://github.com/ruby/ruby/pull/5232
|
|
```ruby
def foo(*); ->{ super }; end
```
This code makes anonymous parameters which is not registered as an
ID. The problem is that when Ractors try to scan `getlocal`
instructions, it puts the Symbol corresponding to the parameter
in to a hash. Since it is not registered, we end up with a
strange exception. This commit wraps the unregistered ID in an
internal ID so that we get the same exception for `...` as `*`.
Co-Authored-By: Aaron Patterson <[email protected]>
Co-Authored-By: John Hawthorn <[email protected]>
Notes:
Merged: https://github.com/ruby/ruby/pull/5035
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/4771
|
|
if an ivar of a class/module refer to a shareable object, this ivar
can be read from non-main Ractors.
Notes:
Merged: https://github.com/ruby/ruby/pull/5006
|
|
env_copy() uses rb_ary_delete_at() with a loop counting up while
iterating through the list of read only locals. rb_ary_delete_at() can
shift elements in the array to an index lesser than the loop index,
causing locals to be missed and set to Qfalse in the returned
environment.
Iterate through the locals in reverse instead, this way the shifting
never happens for locals that are yet to be visited and we process all
the locals in the array.
[Bug #18023]
Notes:
Merged: https://github.com/ruby/ruby/pull/4940
Merged-By: XrXr
|
|
rb_objspace_reachable_objects_from requires that the GC not be active.
Since the Ractor barrier is not executed for incremental sweeping,
Ractor may call rb_objspace_reachable_objects_from after sweeping
has started to share objects. This causes a crash that looks like
the following:
```
<internal:ractor>:627: [BUG] rb_objspace_reachable_objects_from() is not supported while during_gc == true
```
Co-authored-by: Vinicius Stock <[email protected]>
Notes:
Merged: https://github.com/ruby/ruby/pull/4755
|
|
|
|
If the GC has been disabled we need to re-enable it so we can evacuate
the transient heap.
Fixes https://bugs.ruby-lang.org/issues/17985
[Bug #17985] [ruby-core:104260]
Co-authored-by: Aaron Patterson <[email protected]>
Notes:
Merged: https://github.com/ruby/ruby/pull/4596
|
|
Skip the assertion to test the `Ractor.select` from multiple ractors that rarely
fails on Travis arm64.
See <https://bugs.ruby-lang.org/issues/17878>.
Notes:
Merged: https://github.com/ruby/ruby/pull/4518
|
|
Defer making ractor stdio until ractor started.
Before ractor started, created objects belong to the caller ractor
instead of the created ractor.
Notes:
Merged: https://github.com/ruby/ruby/pull/4241
Merged-By: nobu <[email protected]>
|
|
Ractor.allocate and Ractor#dup should not be allowed like Thread.
[Bug #17642]
Notes:
Merged: https://github.com/ruby/ruby/pull/4198
|
|
Fixed the race condition when replacing `freelist` entry with its
chained next element. At acquiring an entry, hold the entry once
with the special value, then release by replacing it with the next
element again after acquired. If another thread is holding the
same entry at that time, spinning until the entry gets released.
Co-Authored-By: Koichi Sasada <[email protected]>
Notes:
Merged: https://github.com/ruby/ruby/pull/4167
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/4142
|
|
Ractor.yield(obj, move: true) and
Ractor.select(..., yield_value: obj, move: true) tried to yield a
value with move semantices, but if the trial is faild, the obj
should not become a moved object.
To keep this rule, `wait_moving` wait status is introduced.
New yield/take process:
(1) If a ractor tried to yield (move:true), make taking racotr's
wait status `wait_moving` and make a moved object by
`ractor_move(obj)` and wakeup taking ractor.
(2) If a ractor tried to take a message from a ractor waiting fo
yielding (move:true), wakeup the ractor and wait for (1).
Notes:
Merged: https://github.com/ruby/ruby/pull/4105
|
|
constant cache `IC` is accessed by non-atomic manner and there are
thread-safety issues, so Ruby 3.0 disables to use const cache on
non-main ractors.
This patch enables it by introducing `imemo_constcache` and allocates
it by every re-fill of const cache like `imemo_callcache`.
[Bug #17510]
Now `IC` only has one entry `IC::entry` and it points to
`iseq_inline_constant_cache_entry`, managed by T_IMEMO object.
`IC` is atomic data structure so `rb_mjit_before_vm_ic_update()` and
`rb_mjit_after_vm_ic_update()` is not needed.
Notes:
Merged: https://github.com/ruby/ruby/pull/4022
|
|
It returns main Ractor, like Thread.main.
[Feature #17418]
Notes:
Merged: https://github.com/ruby/ruby/pull/3963
|
|
This API is similar to plain old Thread#[]/Fiber#[] interface
with symbol key.
Notes:
Merged: https://github.com/ruby/ruby/pull/3962
|
|
TracePoint should be ractor-local because the Proc can violate the
Ractor-safe.
Notes:
Merged: https://github.com/ruby/ruby/pull/3943
|
|
To check shareable-ness, rb_ractor_shareable_p() is needed
for Class/Module objects isntead of checking flags.
|
|
Ractor.make_shareable(obj) tries to make obj a shareable object
by changing the attribute of obj and traversable objects from obj
(mainly freeze them).
"copy: true" option is more conservative approach by make deep
copied object and make it sharable. It doesn't affect any existing
objects.
|
|
|
|
Instead of Ractor.receive, Ractor.receive_if can provide a pattern
by a block and you can choose the receiving message.
[Feature #17378]
Notes:
Merged: https://github.com/ruby/ruby/pull/3862
|
|
trap can accept blopck/Proc and it can violate Rator isolation,
so the Proc should be isolatable when trap is used on non-main ractor.
Notes:
Merged: https://github.com/ruby/ruby/pull/3888
|
|
Instance variables of sharable objects are accessible only from
main ractor, so we need to check it correctly.
Notes:
Merged: https://github.com/ruby/ruby/pull/3887
|
|
ObjectSpace._id2ref(id) can return any objects even if they are
unshareable, so this patch raises RangeError if it runs on multi-ractor
mode and the found object is unshareable.
Notes:
Merged: https://github.com/ruby/ruby/pull/3878
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/3694
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/3848
|
|
Thread's interrupt set Ractor's wakeup_status as interrupted, but
the status remains next Ractor communication API. This patch makes
to ignore the previous interrupt state.
[Bug #17366]
Also this patch solves the Thread#kill and Ractor#take issues.
|
|
Same as 8247b8edde, should not use rb_str_modify() here.
https://bugs.ruby-lang.org/issues/17343#change-88858
Notes:
Merged: https://github.com/ruby/ruby/pull/3833
|
|
ractor_copy() used rb_ary_modify() to make sure this array is not
sharing anything, but it also checks frozen flag. So frozen arrays
raises an error. To solve this issue, this patch introduces new
function rb_ary_cancel_sharing() which makes sure the array does not
share another array and it doesn't check frozen flag.
[Bug #17343]
A test is quoted from https://github.com/ruby/ruby/pull/3817
Notes:
Merged: https://github.com/ruby/ruby/pull/3831
|
|
Followup to #3823
Notes:
Merged: https://github.com/ruby/ruby/pull/3827
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/3823
Merged-By: nobu <[email protected]>
|