summaryrefslogtreecommitdiff
path: root/test/fiber
AgeCommit message (Collapse)Author
2020-09-24test/fiber/scheduler.rb: Prevent "instance variable @urgent not initialized"Yusuke Endoh
2020-09-23strip trailing spaces [ci skip]Nobuyoshi Nakada
2020-09-21Simplify the implementation of Scheduler#blockBenoit Daloze
* This shows block() with a timeout is similar to #kernel_sleep and also does not need to change `@blocking`.
2020-09-21Make `Thread#join` non-blocking.Samuel Williams
Notes: Merged: https://github.com/ruby/ruby/pull/3558
2020-09-21When setting current thread scheduler to nil, invoke `#close`.Samuel Williams
Notes: Merged: https://github.com/ruby/ruby/pull/3557
2020-09-20Remove from waiter in Mutex#lock with ensure when calling rb_scheduler_block()Benoit Daloze
* 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().
2020-09-17Add missing goto found;Benoit Daloze
* To still remove the lock from the Thread's list of acquired locks. * Also to not wake up other waiters and preserve blocking behavior.
2020-09-17Fix Mutex#unlock with a scheduler and thread contentionBenoit Daloze
* It would hit "[BUG] unexpected THREAD_STOPPED" before.
2020-09-17Document the various scheduler hooksBenoit Daloze
2020-09-17Call scheduler.block instead of scheduler.kernel_sleep for blocking ↵Benoit Daloze
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.
2020-09-17Rename scheduler.{mutex_lock,mutex_unlock} to {block,unblock}Benoit Daloze
* Move #kernel_sleep next to #block as it is similar
2020-09-17Use a similar pattern for waiting and readyBenoit Daloze
2020-09-16Add a note at the top of the test schedulerBenoit Daloze
2020-09-14Add support for Queue & SizedQueue.Samuel Williams
Notes: Merged: https://github.com/ruby/ruby/pull/3434
2020-09-14Add support for ConditionVariable.Samuel Williams
Notes: Merged: https://github.com/ruby/ruby/pull/3434
2020-09-14Improve handling of urgent notification pipe.Samuel Williams
Notes: Merged: https://github.com/ruby/ruby/pull/3434
2020-09-14Make Mutex per-Fiber instead of per-ThreadBenoit Daloze
* 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
2020-09-14Rename `Fiber{}` to `Fiber.schedule{}`.Samuel Williams
Notes: Merged: https://github.com/ruby/ruby/pull/3434
2020-09-14Standardised scheduler interface.Samuel Williams
Notes: Merged: https://github.com/ruby/ruby/pull/3434
2020-09-14Simplify bitmasks for IO events.Samuel Williams
Notes: Merged: https://github.com/ruby/ruby/pull/3434
2020-08-18test/fiber/test_backtrace.rb: prevent a warningYusuke Endoh
``` /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 ```
2020-08-18Expose ec -> backtrace (internal) and use it to implement fiber backtrace.Samuel Williams
See <https://bugs.ruby-lang.org/issues/16815> for more details. Notes: Merged: https://github.com/ruby/ruby/pull/3422
2020-07-23Suppress "assigned but unused variable" warningsYusuke Endoh
2020-07-20Remove trailing spaces [ci skip]Nobuyoshi Nakada
2020-07-20Add multi-threaded I/O test.Samuel Williams
Notes: Merged: https://github.com/ruby/ruby/pull/3323
2020-07-20Improve consistency of tests.Samuel Williams
Notes: Merged: https://github.com/ruby/ruby/pull/3323
2020-07-16Remove fiber HTTP test.Samuel Williams
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
2020-07-15Close sockets if blocking to fix leaked fdsNobuyoshi Nakada
2020-06-09Improved assertionsNobuyoshi Nakada
2020-06-09Return seconds slept after Thread.scheduler wait_sleepnicholas a. evans
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
2020-05-23Fixup d48c92aa04ffd3a1cecef599eaa5e4409aab2fe4Hiroshi SHIBATA
2020-05-23Rename TestScheduler* to TestFiber for convention of the test directoryHiroshi SHIBATA
2020-05-15Move `test/scheduler` -> `test/fiber` [Bug #16892][ruby-core:98366].Samuel Williams
Notes: Merged: https://github.com/ruby/ruby/pull/3110