<feed xmlns='http://www.w3.org/2005/Atom'>
<title>ruby.git/test/ruby/test_thread.rb, branch v3_4_9</title>
<subtitle>The Ruby Programming Language</subtitle>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/'/>
<entry>
<title>Reapply "merge revision(s) 62430c19c9f1ab49429cebe65f30588472648c95: [Backport #21342]"</title>
<updated>2025-09-29T22:10:58+00:00</updated>
<author>
<name>Takashi Kokubun</name>
<email>takashikkbn@gmail.com</email>
</author>
<published>2025-09-29T22:10:37+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=264b2d78c366491834c9ce4499a4ad7b7564b89d'/>
<id>264b2d78c366491834c9ce4499a4ad7b7564b89d</id>
<content type='text'>
This reverts commit c414b9871f263331cde0af1c08cf5c1a47e1aedf.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This reverts commit c414b9871f263331cde0af1c08cf5c1a47e1aedf.
</pre>
</div>
</content>
</entry>
<entry>
<title>Revert "merge revision(s) 62430c19c9f1ab49429cebe65f30588472648c95: [Backport #21342]"</title>
<updated>2025-09-29T22:08:47+00:00</updated>
<author>
<name>Takashi Kokubun</name>
<email>takashikkbn@gmail.com</email>
</author>
<published>2025-09-29T22:08:47+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=c414b9871f263331cde0af1c08cf5c1a47e1aedf'/>
<id>c414b9871f263331cde0af1c08cf5c1a47e1aedf</id>
<content type='text'>
This reverts commit 4306c9048fb674d24b92dc46b6746a4749564147.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This reverts commit 4306c9048fb674d24b92dc46b6746a4749564147.
</pre>
</div>
</content>
</entry>
<entry>
<title>merge revision(s) 62430c19c9f1ab49429cebe65f30588472648c95: [Backport #21342]</title>
<updated>2025-09-29T21:35:15+00:00</updated>
<author>
<name>Takashi Kokubun</name>
<email>takashikkbn@gmail.com</email>
</author>
<published>2025-09-29T21:35:15+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=4306c9048fb674d24b92dc46b6746a4749564147'/>
<id>4306c9048fb674d24b92dc46b6746a4749564147</id>
<content type='text'>
	Properly unlock locked mutexes on thread cleanup.

	Mutexes were being improperly unlocked on thread cleanup. This bug was
	introduced in 050a8954395.

	We must keep a reference from the mutex to the thread, because if the fiber
	is collected before the mutex is, then we cannot unlink it from the thread in
	`mutex_free`. If it's not unlinked from the the thread when it's freed, it
	causes bugs in `rb_thread_unlock_all_locking_mutexes`.

	We now mark the fiber when a mutex is locked, and the thread is marked
	as well. However, a fiber can still be freed in the same GC cycle as the
	mutex, so the reference to the thread is still needed.

	The reason we need to mark the fiber is that `mutex_owned_p()` has an ABA
	issue where if the fiber is collected while it's locked, a new fiber could be
	allocated at the same memory address and we could get false positives.

	Fixes [Bug #21342]

	Co-authored-by: John Hawthorn &lt;john@hawthorn.email&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
	Properly unlock locked mutexes on thread cleanup.

	Mutexes were being improperly unlocked on thread cleanup. This bug was
	introduced in 050a8954395.

	We must keep a reference from the mutex to the thread, because if the fiber
	is collected before the mutex is, then we cannot unlink it from the thread in
	`mutex_free`. If it's not unlinked from the the thread when it's freed, it
	causes bugs in `rb_thread_unlock_all_locking_mutexes`.

	We now mark the fiber when a mutex is locked, and the thread is marked
	as well. However, a fiber can still be freed in the same GC cycle as the
	mutex, so the reference to the thread is still needed.

	The reason we need to mark the fiber is that `mutex_owned_p()` has an ABA
	issue where if the fiber is collected while it's locked, a new fiber could be
	allocated at the same memory address and we could get false positives.

	Fixes [Bug #21342]

	Co-authored-by: John Hawthorn &lt;john@hawthorn.email&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Remove dependency on fiddle from test/ruby</title>
<updated>2024-06-04T10:53:04+00:00</updated>
<author>
<name>Hiroshi SHIBATA</name>
<email>hsbt@ruby-lang.org</email>
</author>
<published>2024-06-04T08:53:49+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=892849ac986f7e4121e22c7d532d6d6937c0f12c'/>
<id>892849ac986f7e4121e22c7d532d6d6937c0f12c</id>
<content type='text'>
Co-authored-by: "Nobuyoshi Nakada" &lt;nobu@ruby-lang.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Co-authored-by: "Nobuyoshi Nakada" &lt;nobu@ruby-lang.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>M:N thread scheduler for Ractors</title>
<updated>2023-10-12T05:47:01+00:00</updated>
<author>
<name>Koichi Sasada</name>
<email>ko1@atdot.net</email>
</author>
<published>2023-04-10T01:53:13+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=be1bbd5b7d40ad863ab35097765d3754726bbd54'/>
<id>be1bbd5b7d40ad863ab35097765d3754726bbd54</id>
<content type='text'>
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]
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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]
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix Thread#native_thread_id being cached across fork (#8418)</title>
<updated>2023-09-15T01:33:32+00:00</updated>
<author>
<name>KJ Tsanaktsidis</name>
<email>kj@kjtsanaktsidis.id.au</email>
</author>
<published>2023-09-15T01:33:32+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=0117a6d389c5b607eaec1b7f917132efa356f665'/>
<id>0117a6d389c5b607eaec1b7f917132efa356f665</id>
<content type='text'>
The native thread ID can and does change on some operating systems (e.g.
Linux) after forking, so it needs to be re-queried.

[Bug #19873]</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The native thread ID can and does change on some operating systems (e.g.
Linux) after forking, so it needs to be re-queried.

[Bug #19873]</pre>
</div>
</content>
</entry>
<entry>
<title>Remove --disable-gems in assert_in_out_err</title>
<updated>2023-08-28T19:05:19+00:00</updated>
<author>
<name>Peter Zhu</name>
<email>peter@peterzhu.ca</email>
</author>
<published>2023-08-26T23:31:46+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=91de37c23ec6b048e45df79cef1cb93a86316929'/>
<id>91de37c23ec6b048e45df79cef1cb93a86316929</id>
<content type='text'>
assert_in_out_err adds --disable=gems so we don't need to add
--disable-gems in the args list.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
assert_in_out_err adds --disable=gems so we don't need to add
--disable-gems in the args list.
</pre>
</div>
</content>
</entry>
<entry>
<title>s/MJIT/RJIT/</title>
<updated>2023-03-07T07:44:01+00:00</updated>
<author>
<name>Takashi Kokubun</name>
<email>takashikkbn@gmail.com</email>
</author>
<published>2023-03-07T07:15:30+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=2e875549a934fa04b7939810fa0d8a2762702aaa'/>
<id>2e875549a934fa04b7939810fa0d8a2762702aaa</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Wait killed thread</title>
<updated>2022-12-02T07:20:43+00:00</updated>
<author>
<name>Nobuyoshi Nakada</name>
<email>nobu@ruby-lang.org</email>
</author>
<published>2022-12-02T07:20:43+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=ad4eab1a8ccacf7dc79a73407978a5591062f057'/>
<id>ad4eab1a8ccacf7dc79a73407978a5591062f057</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Make pending_interrupt?(Exception) work</title>
<updated>2022-11-09T03:25:35+00:00</updated>
<author>
<name>Yusuke Endoh</name>
<email>mame@ruby-lang.org</email>
</author>
<published>2022-11-08T04:35:37+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=c3de7a3c58bf9a138ff8720ed56c0045d2b8e01d'/>
<id>c3de7a3c58bf9a138ff8720ed56c0045d2b8e01d</id>
<content type='text'>
A patch from katsu (Katsuhiro Ueno)

[Bug #19110]
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
A patch from katsu (Katsuhiro Ueno)

[Bug #19110]
</pre>
</div>
</content>
</entry>
</feed>
