summaryrefslogtreecommitdiff
path: root/bootstraptest/test_thread.rb
AgeCommit message (Collapse)Author
2023-12-21RJIT: Streamline RJIT enablement checkTakashi Kokubun
in bootstrap tests so that `make btest-bruby` skips the right tests.
2023-10-12M:N thread scheduler for RactorsKoichi Sasada
This patch introduce M:N thread scheduler for Ractor system. In general, M:N thread scheduler employs N native threads (OS threads) to manage M user-level threads (Ruby threads in this case). On the Ruby interpreter, 1 native thread is provided for 1 Ractor and all Ruby threads are managed by the native thread. From Ruby 1.9, the interpreter uses 1:1 thread scheduler which means 1 Ruby thread has 1 native thread. M:N scheduler change this strategy. Because of compatibility issue (and stableness issue of the implementation) main Ractor doesn't use M:N scheduler on default. On the other words, threads on the main Ractor will be managed with 1:1 thread scheduler. There are additional settings by environment variables: `RUBY_MN_THREADS=1` enables M:N thread scheduler on the main ractor. Note that non-main ractors use the M:N scheduler without this configuration. With this configuration, single ractor applications run threads on M:1 thread scheduler (green threads, user-level threads). `RUBY_MAX_CPU=n` specifies maximum number of native threads for M:N scheduler (default: 8). This patch will be reverted soon if non-easy issues are found. [Bug #19842]
2023-07-11Skip a flaky test for RJITTakashi Kokubun
2023-03-10RJIT: Skip a flaky test_thread test for nowTakashi Kokubun
and unskip a ractor test that was actually running
2022-02-06support concurrent btest executionKoichi Sasada
* `-j` option for concurrent test with threads * `-jN` uses N threads * `-j` uses nproc/2 threads * Introduce `BT` struct to manage configurations * Introduce `Assertion` to manage all assertions * Remove all toplevel instance variables * Show elapsed seconds at last ``` $ time make btest ... real 0m37.319s user 0m26.221s sys 0m16.534s $ time make btest TESTOPTS=-j ... real 0m11.812s user 0m36.667s sys 0m21.872s ``` Notes: Merged: https://github.com/ruby/ruby/pull/5528
2020-04-09should check pending interrupts correctly.Koichi Sasada
rb_uninterruptible() disables any interrupts using handle_interrupt feature (This function is used by `p`). After this function, pending interrupts should be checked correctly, however there is no chance to setup interrupt flag of working threads, it means that nobody checks pending interrupts. For example, it ignores terminate signal delivered at the end of main thread and program can't stop. This patch set interrupt flag if there are pending interrupts.
2020-03-23disable to show the maximum number of threads.Koichi Sasada
On Deiban 9 environment, the thread tests failed and this maximum threads information can finish up the machine resources. To check it, I turned-off showing this information.
2019-12-12Show the failed message tooNobuyoshi Nakada
2019-12-11Show the failed messageNobuyoshi Nakada
2019-09-03Move an unstable bootstraptest to pendingTakashi Kokubun
This has been unstable on AppVeyor mswin since the introduction 3fd83cb6fcc483d2eac0795bc139c521a3a59bd2. https://ci.appveyor.com/project/ruby/ruby/builds/27103307/job/j7xwjmsos2k22cck Let's have it in pending.rb to be fixed.
2019-08-14Compare actual resultNobuyoshi Nakada
2019-07-12Improved fiber benchmarks. Increase number of iterations.Samuel Williams
2019-06-19* remove trailing spaces, expand tabs.git
2019-06-19Show thread and fiber limits as part of bootstrap tests.Samuel Williams
2019-06-19Improve benchmarks and tests for threads.Samuel Williams
2018-11-20revert r65820 and retry assert_finishk0kubun
From: MSP-Greg <greg.mpls@gmail.com> https://github.com/ruby/ruby/commit/5187ea768f57315e61486122d688f1992d4cb21f git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65821 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-11-20test_thread.rb: skip test_thread.rb broken for Windowsk0kubun
msys2. https://ci.appveyor.com/project/ruby/ruby/builds/20419607/job/fuvrfcmrhxr1r1cr https://ci.appveyor.com/project/ruby/ruby/builds/20395349/job/2nqewb06b5eanwea https://ci.appveyor.com/project/ruby/ruby/builds/20382452/job/658pvl1cqolyrixm git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65820 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-08-30Use qualified namesnobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56037 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-04-06btest: resource limitnobu
* bootstraptest/test_thread.rb: rescue resource limitation errors. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54501 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-09-21wait until the thread is stopped.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47667 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-06-08test_thread.rb: remove garbagenobu
* bootstraptest/test_thread.rb: remove a garbage line for debug. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46380 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-06-07bootstraptest/test_{fork,io,thread}.rb: reduce sleep timesnobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46379 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-12-05fix matchingnobu
* bootstraptest/test_thread.rb: String#=~ does not accept String. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44016 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-23* bootstraptest/test_thread.rb: rescue resource limitation errors.ko1
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41585 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-01-01* bootstraptest/test_thread.rb: get rid of confusing ruby-mode.elnobu
indent. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38671 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-01-01* bootstraptest/test_thread.rb: get rid of "invalid nest" error innobu
ruby-mode.el. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38670 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-26* bootstraptest/test_thread.rb: try to `join' each 100ko1
threads. This benchmark seems consuming long time on travis-ci several times (and make `failure'). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37859 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-04-27* insns.def (onceinlinecache): add exclusion control for a regionmame
between onceinlinecache and setinlinecache. [ruby-dev:39768] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27515 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-04-22* bootstraptest/test_thread.rb: fix test. [Bug #2342]mame
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27445 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-12-11* bootstraptest/test_thread.rb: please please please remember that there areusa
platforms that do not support fork. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26066 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-12-10* thread_pthread.c (native_mutex_reinitialize_atfork): release andnobu
re-acquire the lock at re-initialization. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26061 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-11-24* bootstraptest/test_thread.rb: propagate the exception within a thread tousa
outer. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25898 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-11-19* test_thread.rb: DO NOT USE FORK WITHOUT RESCUE.usa
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25850 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-11-18* thread.c (rb_thread_atfork_internal): reinitialize global locknobu
at fork to get rid of deadlock. based on the patch from Hongli Lai in [ruby-core:26783]. [ruby-core:26361] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25842 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-11-15* thread.c (thread_cleanup_func): delete locking_mutex when threadmame
object become dummy because of fork. [ruby-core:26744] [ruby-core:26745] * bootstraptest/test_thread.rb: add a test for above. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25771 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-09-11* bootstraptest/test_thread.rb: just check for normal exit.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24850 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-06-22fix tests for load_path.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23817 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-26* test_thread.rb: broken test.usa
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22642 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-23* bootstraptest/test_thread.rb: fix for environment where fork is notmame
available. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22578 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-23* thread.c (thread_cleanup_func): unlock all locked mutexes even whenmame
forking. [ruby-core:22269] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22577 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-10-28 * bootstraptest/test_thread.rb: ignore some exceptions.usa
[ruby-dev:36951] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19973 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-31* bootstraptest/test_thread.rb: add a test.ko1
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18983 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-07-10add ML ref.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18013 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-07-10* vm_core.h (rb_thread_t), vm.c (rb_thread_mark), process.cnobu
(rb_last_status_get, rb_last_status_set, rb_last_status_clear): moved last_status from rb_vm_t. [ruby-dev:35414] * vm.c (th_init2): initialize last_status with nil. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17985 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-06-12* thread.c, vm_core.h, vm.c, thread_pthread.c, thread_win32.c: addmame
deadlock detection. [ruby-dev:35044] * bootstraptest/test_thread.rb: add tests for above. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17110 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-06-10* vm.c, eval_intern.h (PASS_PASSED_BLOCK):ko1
set a VM_FRAME_FLAG_PASSED flag to skip this frame when searching ruby-level-cfp. * eval.c, eval_intern.h, proc.c: fix to check cfp. if there is no valid ruby-level-cfp, cause RuntimeError exception. [ruby-dev:34128] * vm_core.h, vm_evalbody.c, vm.c, vm_dump.c, vm_insnhelper.c, insns.def: rename FRAME_MAGIC_* to VM_FRAME_MAGIC_*. * KNOWNBUGS.rb, bootstraptest/test*.rb: move solved bugs. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17084 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-05-19* bootstraptest/test_knownbug.rb: move solved tests.ko1
* bootstraptest/test_eval.rb, test_literal.rb, test_syntax.rb, test_thread.rb: ditto. * test/ruby/test_m17n.rb, test_proc.rb, test_sprintf.rb, test_string.rb, test/ruby/test_struct.rb: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16472 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-05-08* thread.c (rb_gc_save_machine_context): call FLUSH_REGISTER_WINDOWSakr
to mark the register stack from GC on another thread. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16328 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-04-22* thread.c (rb_thread_stop_timer_thread): should clearmatz
timer_thread_id after stopping it. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16136 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-04-22* thread.c (thread_join): remove the current thread from the join listnobu
of the target thread. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16135 b2dd03c8-39d4-4d8f-98ff-823fe69b080e