<feed xmlns='http://www.w3.org/2005/Atom'>
<title>ruby.git/thread.c, 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>[3.4] Fix deadlock on th-&gt;interrupt_lock after fork</title>
<updated>2026-03-07T04:41:44+00:00</updated>
<author>
<name>Jean Boussier</name>
<email>jean.boussier@gmail.com</email>
</author>
<published>2026-02-04T12:12:42+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=43771bb0efcd139acd9112a770e8b8d719118dce'/>
<id>43771bb0efcd139acd9112a770e8b8d719118dce</id>
<content type='text'>
[Bug #21860]

If a thread was holding this lock before fork, it will not exist in the
child process. We should re-initialize these locks as we do with the VM
locks when forking.

Co-Authored-By: John Hawthorn &lt;john@hawthorn.email&gt;
Co-authored-by: Aaron Patterson &lt;tenderlove@ruby-lang.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
[Bug #21860]

If a thread was holding this lock before fork, it will not exist in the
child process. We should re-initialize these locks as we do with the VM
locks when forking.

Co-Authored-By: John Hawthorn &lt;john@hawthorn.email&gt;
Co-authored-by: Aaron Patterson &lt;tenderlove@ruby-lang.org&gt;
</pre>
</div>
</content>
</entry>
<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>merge revision(s) 0d6263bd416338a339651fb97fe4d62701704c4b: [Backport #21220]</title>
<updated>2025-04-14T07:25:55+00:00</updated>
<author>
<name>Takashi Kokubun</name>
<email>takashikkbn@gmail.com</email>
</author>
<published>2025-04-14T07:25:55+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=1b6f9cd6ea5715ad33d8ba4c78382aa8aafdbcd4'/>
<id>1b6f9cd6ea5715ad33d8ba4c78382aa8aafdbcd4</id>
<content type='text'>
	Fix coverage measurement for negative line numbers

	Fixes [Bug #21220]

	Co-Authored-By: Mike Bourgeous &lt;mike@mikebourgeous.com&gt;
	Co-Authored-By: Jean Boussier &lt;jean.boussier@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
	Fix coverage measurement for negative line numbers

	Fixes [Bug #21220]

	Co-Authored-By: Mike Bourgeous &lt;mike@mikebourgeous.com&gt;
	Co-Authored-By: Jean Boussier &lt;jean.boussier@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Check RUBY_THREAD_TIMESLICE value</title>
<updated>2024-12-18T02:12:34+00:00</updated>
<author>
<name>Nobuyoshi Nakada</name>
<email>nobu@ruby-lang.org</email>
</author>
<published>2024-12-13T02:52:19+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=57f6329ba7aa744101efe026bea0a0bd46c77fc8'/>
<id>57f6329ba7aa744101efe026bea0a0bd46c77fc8</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Add an environment variable for controlling the default Thread quantum</title>
<updated>2024-12-13T00:04:49+00:00</updated>
<author>
<name>Aaron Patterson</name>
<email>tenderlove@ruby-lang.org</email>
</author>
<published>2024-11-01T22:06:35+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=fffef9aa5d89b6cca3dc634f5278b1fc67fb3d08'/>
<id>fffef9aa5d89b6cca3dc634f5278b1fc67fb3d08</id>
<content type='text'>
This commit adds an environment variable `RUBY_THREAD_TIMESLICE` for
specifying the default thread quantum in milliseconds.  You can adjust
this variable to tune throughput, which is especially useful on
multithreaded systems that are mixing CPU bound work and IO bound work.

The default quantum remains 100ms.

[Feature #20861]

Co-Authored-By: John Hawthorn &lt;john@hawthorn.email&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This commit adds an environment variable `RUBY_THREAD_TIMESLICE` for
specifying the default thread quantum in milliseconds.  You can adjust
this variable to tune throughput, which is especially useful on
multithreaded systems that are mixing CPU bound work and IO bound work.

The default quantum remains 100ms.

[Feature #20861]

Co-Authored-By: John Hawthorn &lt;john@hawthorn.email&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Introduce `Fiber::Scheduler#blocking_operation_wait`. (#12016)</title>
<updated>2024-11-20T06:40:17+00:00</updated>
<author>
<name>Samuel Williams</name>
<email>samuel.williams@oriontransfer.co.nz</email>
</author>
<published>2024-11-20T06:40:17+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=9c268302bfb4890d3757caa60981802a88bfbd89'/>
<id>9c268302bfb4890d3757caa60981802a88bfbd89</id>
<content type='text'>
Redirect `rb_nogvl` blocking operations to the fiber scheduler if possible
to prevent stalling the event loop.

[Feature #20876]</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Redirect `rb_nogvl` blocking operations to the fiber scheduler if possible
to prevent stalling the event loop.

[Feature #20876]</pre>
</div>
</content>
</entry>
<entry>
<title>introduce `rb_ec_check_ints()`</title>
<updated>2024-11-08T09:02:46+00:00</updated>
<author>
<name>Koichi Sasada</name>
<email>ko1@atdot.net</email>
</author>
<published>2024-11-05T17:31:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=97aaf6f760259c639dc3ceb3a80fe82411649569'/>
<id>97aaf6f760259c639dc3ceb3a80fe82411649569</id>
<content type='text'>
to avoid TLS issue with N:M threads.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
to avoid TLS issue with N:M threads.
</pre>
</div>
</content>
</entry>
<entry>
<title>`interrupt_exec`</title>
<updated>2024-11-08T09:02:46+00:00</updated>
<author>
<name>Koichi Sasada</name>
<email>ko1@atdot.net</email>
</author>
<published>2024-11-04T18:55:52+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=c8297c3eed571e978dded34dd2036a53d6f28bb3'/>
<id>c8297c3eed571e978dded34dd2036a53d6f28bb3</id>
<content type='text'>
introduce
- rb_threadptr_interrupt_exec
- rb_ractor_interrupt_exec

to intercept the thread/ractor execution.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
introduce
- rb_threadptr_interrupt_exec
- rb_ractor_interrupt_exec

to intercept the thread/ractor execution.
</pre>
</div>
</content>
</entry>
</feed>
