aboutsummaryrefslogtreecommitdiffstats
path: root/test/fiber
Commit message (Collapse)AuthorAgeFilesLines
* Add verbose nil in testingDelton Ding2020-12-231-0/+1
|
* Enable `Fiber.current` and `Fiber#alive?` call inside ractorDelton Ding2020-12-231-0/+22
|
* Add support for non-blocking `Process.wait`.Samuel Williams2020-12-092-0/+43
|
* Fix TestFiberMutex#test_condition_variable assertionBenoit Daloze2020-11-081-5/+3
| | | | * Now that it works correctly.
* Urgent notification pipe has same lifetime as scheduler.Samuel Williams2020-11-081-11/+10
|
* Defer `kernel_sleep` to `block` to avoid exiting the event loop when ↵Samuel Williams2020-11-081-6/+1
| | | | duration is nil.
* Rename to `Fiber#set_scheduler`.Samuel Williams2020-11-076-22/+38
|
* Refined assertions for better failure messagesNobuyoshi Nakada2020-10-011-4/+4
|
* strip trailing spaces [ci skip]Nobuyoshi Nakada2020-10-011-1/+1
|
* Remove `Thread.scheduler` from public interface.Samuel Williams2020-10-011-7/+6
| | | | | | It's implementation is equivalent to: Thread.current.scheduler unless Thread.current.blocking?
* Raise an exception if the scheduler was already closed.Samuel Williams2020-10-011-0/+2
|
* Don't call `Scheduler#close` if it doesn't exist.Samuel Williams2020-10-011-0/+8
|
* Fix order of operations during `rb_ec_finalize`.Samuel Williams2020-09-301-0/+14
|
* Remove unnecessary executable bit [ci skip]Kazuhiro NISHIYAMA2020-09-281-0/+0
|
* test/fiber/scheduler.rb: Prevent "instance variable @urgent not initialized"Yusuke Endoh2020-09-241-0/+2
|
* strip trailing spaces [ci skip]Nobuyoshi Nakada2020-09-231-1/+1
|
* Simplify the implementation of Scheduler#blockBenoit Daloze2020-09-211-13/+15
| | | | | * This shows block() with a timeout is similar to #kernel_sleep and also does not need to change `@blocking`.
* Make `Thread#join` non-blocking.Samuel Williams2020-09-211-6/+16
|
* When setting current thread scheduler to nil, invoke `#close`.Samuel Williams2020-09-212-0/+40
|
* Remove from waiter in Mutex#lock with ensure when calling rb_scheduler_block()Benoit Daloze2020-09-201-0/+32
| | | | | * 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().
* Add missing goto found;Benoit Daloze2020-09-171-1/+2
| | | | | * To still remove the lock from the Thread's list of acquired locks. * Also to not wake up other waiters and preserve blocking behavior.
* Fix Mutex#unlock with a scheduler and thread contentionBenoit Daloze2020-09-171-0/+23
| | | | * It would hit "[BUG] unexpected THREAD_STOPPED" before.
* Document the various scheduler hooksBenoit Daloze2020-09-171-0/+3
|
* Call scheduler.block instead of scheduler.kernel_sleep for blocking ↵Benoit Daloze2020-09-172-1/+27
| | | | | | | 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.
* Rename scheduler.{mutex_lock,mutex_unlock} to {block,unblock}Benoit Daloze2020-09-171-12/+15
| | | | * Move #kernel_sleep next to #block as it is similar
* Use a similar pattern for waiting and readyBenoit Daloze2020-09-171-4/+3
|
* Add a note at the top of the test schedulerBenoit Daloze2020-09-161-0/+4
|
* Add support for Queue & SizedQueue.Samuel Williams2020-09-141-0/+31
|
* Add support for ConditionVariable.Samuel Williams2020-09-142-1/+40
|
* Improve handling of urgent notification pipe.Samuel Williams2020-09-141-14/+12
|
* Make Mutex per-Fiber instead of per-ThreadBenoit Daloze2020-09-142-7/+77
| | | | | | | | | * 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]
* Rename `Fiber{}` to `Fiber.schedule{}`.Samuel Williams2020-09-145-11/+11
|
* Standardised scheduler interface.Samuel Williams2020-09-143-76/+2
|
* Simplify bitmasks for IO events.Samuel Williams2020-09-141-2/+2
|
* test/fiber/test_backtrace.rb: prevent a warningYusuke Endoh2020-08-181-2/+2
| | | | | | | | | | | ``` /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 ```
* Expose ec -> backtrace (internal) and use it to implement fiber backtrace.Samuel Williams2020-08-181-0/+22
| | | | See <https://bugs.ruby-lang.org/issues/16815> for more details.
* Suppress "assigned but unused variable" warningsYusuke Endoh2020-07-231-2/+2
|
* Remove trailing spaces [ci skip]Nobuyoshi Nakada2020-07-201-2/+2
|
* Add multi-threaded I/O test.Samuel Williams2020-07-201-0/+23
|
* Improve consistency of tests.Samuel Williams2020-07-203-5/+13
|
* Remove fiber HTTP test.Samuel Williams2020-07-161-28/+0
| | | | | | 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.
* Close sockets if blocking to fix leaked fdsNobuyoshi Nakada2020-07-151-1/+7
|
* Improved assertionsNobuyoshi Nakada2020-06-091-2/+2
|
* Return seconds slept after Thread.scheduler wait_sleepnicholas a. evans2020-06-091-1/+18
| | | | | | Kernel#sleep should still return seconds slept, even when using a Thread.scheduler. The return value of Scheduler#wait_sleep can be ignored.
* Fixup d48c92aa04ffd3a1cecef599eaa5e4409aab2fe4Hiroshi SHIBATA2020-05-231-1/+1
|
* Rename TestScheduler* to TestFiber for convention of the test directoryHiroshi SHIBATA2020-05-236-6/+6
|
* Move `test/scheduler` -> `test/fiber` [Bug #16892][ruby-core:98366].Samuel Williams2020-05-158-0/+428