Age | Commit message (Collapse) | Author |
|
If the thread termination invokes user code after `th->status` becomes
`THREAD_KILLED`, and the user unblock function causes that `th->status` to
become something else (e.g. `THREAD_RUNNING`), threads waiting in
`thread_join_sleep` will hang forever. We move the unblock function call
to before the thread status is updated, and allow threads to join as soon
as `th->value` becomes defined.
This reverts commit 6505c77501f1924571b2fe620c5c7b31ede0cd22.
|
|
|
|
|
|
* Wake up join list within thread EC context.
* Consume items from join list so that they are not re-executed.
If `rb_fiber_scheduler_unblock` raises an exception, it can result in a
segfault if `rb_threadptr_join_list_wakeup` is not within a valid EC. This
change moves `rb_threadptr_join_list_wakeup` into the thread's top level EC
which initially caused an infinite loop because on exception will retry. We
explicitly remove items from the thread's join list to avoid this situation.
* Verify the required scheduler interface.
* Test several scheduler hooks methods with broken `unblock` implementation.
|
|
[Backport #17666]
Co-authored-by: Samuel Williams <@ioquatix>
https://github.com/nagachika/ruby/pull/1/commits/2cee515f024f3295945f312cb6b052f972f9c93d
|
|
611e711085c7e3984555a79626d025c8b876eced,a9c5c2d614f30a616970245fef3e7ffc151e2ecf: [Backport #17527]
Test incorrect behaviour of `rb_io_wait_readable/writable`.
---
test/fiber/test_io.rb | 35 +++++++++++++++++++++++++++++++++++
1 file changed, 35 insertions(+)
Check errno before invoking scheduler in
`rb_io_wait_readable/writable`.
See <https://bugs.ruby-lang.org/issues/17527> for more details.
---
io.c | 66 +++++++++++++++++++++++++++++++++++-------------------------------
1 file changed, 35 insertions(+), 31 deletions(-)
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/3971
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/3971
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/3853
|
|
* Now that it works correctly.
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/3743
|
|
duration is nil.
Notes:
Merged: https://github.com/ruby/ruby/pull/3743
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/3742
|
|
|
|
|
|
It's implementation is equivalent to:
Thread.current.scheduler unless Thread.current.blocking?
Notes:
Merged: https://github.com/ruby/ruby/pull/3610
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/3612
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/3612
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/3605
|
|
|
|
|
|
|
|
* This shows block() with a timeout is similar to #kernel_sleep and also
does not need to change `@blocking`.
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/3558
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/3557
|
|
* Previously this could lead to an invalid waiter entry and then trying
to wake up that waiter would result in various issues in rb_mutex_unlock_th().
|
|
* To still remove the lock from the Thread's list of acquired locks.
* Also to not wake up other waiters and preserve blocking behavior.
|
|
* It would hit "[BUG] unexpected THREAD_STOPPED" before.
|
|
|
|
Queue/SizedQueue operations
* scheduler.unblock was already already called before but with no corresponding scheduler.block
* add test that Queue#pop makes the scheduler wait until it gets an element.
|
|
* Move #kernel_sleep next to #block as it is similar
|
|
|
|
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/3434
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/3434
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/3434
|
|
* Enables Mutex to be used as synchronization between multiple Fibers
of the same Thread.
* With a Fiber scheduler we can yield to another Fiber on contended
Mutex#lock instead of blocking the entire thread.
* This also makes the behavior of Mutex consistent across CRuby, JRuby and TruffleRuby.
* [Feature #16792]
Notes:
Merged: https://github.com/ruby/ruby/pull/3434
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/3434
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/3434
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/3434
|
|
```
/home/chkbuild/chkbuild/tmp/build/20200818T033004Z/ruby/test/fiber/test_backtrace.rb:9:
warning: ambiguous first argument; put parentheses or a space even after
`/' operator
/home/chkbuild/chkbuild/tmp/build/20200818T033004Z/ruby/test/fiber/test_backtrace.rb:15:
warning: ambiguous first argument; put parentheses or a space even after
`/' operator
```
|
|
See <https://bugs.ruby-lang.org/issues/16815> for more details.
Notes:
Merged: https://github.com/ruby/ruby/pull/3422
|
|
|
|
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/3323
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/3323
|
|
The HTTP test hits a remote website which isn't always available and is
not self-contained. Ideally we will rewrite this test with an internal
web server.
Notes:
Merged: https://github.com/ruby/ruby/pull/3321
|
|
|
|
|
|
Kernel#sleep should still return seconds slept, even when using a
Thread.scheduler. The return value of Scheduler#wait_sleep can be
ignored.
Notes:
Merged: https://github.com/ruby/ruby/pull/3198
|