summaryrefslogtreecommitdiff
path: root/test/fiber/test_scheduler.rb
AgeCommit message (Collapse)Author
2025-03-16merge revision(s) 08b3a45bc97c835b4677bf76dbce68fd51d81897: [Backport #21180]nagachika
Push a real iseq in rb_vm_push_frame_fname() Previously, vm_make_env_each() (used during proc creation and for the debug inspector C API) picked up the non-GC-allocated iseq that rb_vm_push_frame_fname() creates, which led to a SEGV when the GC tried to mark the non GC object. Put a real iseq imemo instead. Speed should be about the same since the old code also did a imemo allocation and a malloc allocation. Real iseq allows ironing out the special-casing of dummy frames in rb_execution_context_mark() and rb_execution_context_update(). A check is added to RubyVM::ISeq#eval, though, to stop attempts to run dummy iseqs. [Bug #21180] Co-authored-by: Aaron Patterson <tenderlove@ruby-lang.org>
2025-01-14merge revision(s) a8c2d5e7bee5fad0965baeb58d312ddc5932ec26: [Backport #20907]Takashi Kokubun
Ensure fiber scheduler re-acquires mutex when interrupted from sleep. (#12158) [Bug #20907]
2023-09-07Reduce number of iterations in `TestFiberScheduler#test_autoload`. (#8391)Samuel Williams
`ppc64le` appears to be struggling with this test due to timeout. Let's see if reducing the number of iterations can help improve the test performance. Notes: Merged-By: ioquatix <samuel@codeotaku.com>
2022-12-02Wait killed threadsNobuyoshi Nakada
2022-10-20Avoid missed wakeup with fiber scheduler and Fiber.blocking. (#6588)Samuel Williams
* Ensure that blocked fibers don't prevent valid wakeups. Notes: Merged-By: ioquatix <samuel@codeotaku.com>
2022-10-13Add missing `f.resume` to fiber test. (#6539)Samuel Williams
Notes: Merged-By: ioquatix <samuel@codeotaku.com>
2022-10-06Introduce `Fiber.blocking{}` for bypassing the fiber scheduler. (#6498)Samuel Williams
Notes: Merged-By: ioquatix <samuel@codeotaku.com>
2022-05-25Retain reference to blocking fibers.Samuel Williams
Notes: Merged: https://github.com/ruby/ruby/pull/5926
2022-05-09test/fiber/test_scheduler.rb: Remove the test file from $LOADED_FEATURESYusuke Endoh
to prevent the following failure on `make test-all --repeat-count=2` http://ci.rvm.jp/results/trunk-repeat20-asserts@phosphorus-docker/3957774 ``` 1) Error: TestFiberScheduler#test_autoload: NameError: uninitialized constant TestFiberSchedulerAutoload Object.const_get(:TestFiberSchedulerAutoload) ^^^^^^^^^^ ```
2022-05-08Use a proper mutex for autoloading features. (#5788)Samuel Williams
Object#autoload implements a custom per-thread "mutex" for blocking threads waiting on autoloading a feature. This causes problems when used with the fiber scheduler. We swap the implementation to use a Ruby mutex which is fiber aware. Notes: Merged-By: ioquatix <samuel@codeotaku.com>
2021-11-10Mark IO::Buffer as experimental.Samuel Williams
Notes: Merged: https://github.com/ruby/ruby/pull/4621
2021-06-14Wake up join list within thread EC context. (#4471)Samuel Williams
* 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. Notes: Merged-By: ioquatix <samuel@codeotaku.com>
2021-03-30Fix handling of timeout accessing scheduler outside of non-blocking context.Samuel Williams
Notes: Merged: https://github.com/ruby/ruby/pull/4173
2020-11-07Rename to `Fiber#set_scheduler`.Samuel Williams
Notes: Merged: https://github.com/ruby/ruby/pull/3742
2020-10-01strip trailing spaces [ci skip]Nobuyoshi Nakada
2020-10-01Don't call `Scheduler#close` if it doesn't exist.Samuel Williams
Notes: Merged: https://github.com/ruby/ruby/pull/3612
2020-09-30Fix order of operations during `rb_ec_finalize`.Samuel Williams
Notes: Merged: https://github.com/ruby/ruby/pull/3605
2020-09-23strip trailing spaces [ci skip]Nobuyoshi Nakada
2020-09-21When setting current thread scheduler to nil, invoke `#close`.Samuel Williams
Notes: Merged: https://github.com/ruby/ruby/pull/3557
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-05-23Fixup d48c92aa04ffd3a1cecef599eaa5e4409aab2fe4Hiroshi SHIBATA
2020-05-23Rename TestScheduler* to TestFiber for convention of the test directoryHiroshi SHIBATA