<feed xmlns='http://www.w3.org/2005/Atom'>
<title>ruby.git/thread_sync.c, branch v3_3_11</title>
<subtitle>The Ruby Programming Language</subtitle>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/'/>
<entry>
<title>merge revision(s) 62430c19c9f1ab49429cebe65f30588472648c95: [Backport #21342]</title>
<updated>2025-10-05T10:10:48+00:00</updated>
<author>
<name>nagachika</name>
<email>nagachika@ruby-lang.org</email>
</author>
<published>2025-10-05T10:10:48+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=05f93fe6dc6f99fd2f728dd3c85dca944f1f4ba1'/>
<id>05f93fe6dc6f99fd2f728dd3c85dca944f1f4ba1</id>
<content type='text'>
	Message not found for revision: 62430c19c9f1ab49429cebe65f30588472648c95
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
	Message not found for revision: 62430c19c9f1ab49429cebe65f30588472648c95
</pre>
</div>
</content>
</entry>
<entry>
<title>merge revision(s) a8c2d5e7bee5fad0965baeb58d312ddc5932ec26: [Backport #20907]</title>
<updated>2025-01-15T01:47:41+00:00</updated>
<author>
<name>Takashi Kokubun</name>
<email>takashikkbn@gmail.com</email>
</author>
<published>2025-01-15T01:47:41+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=f19831a15d680fd995ceaecad1157282be7182dc'/>
<id>f19831a15d680fd995ceaecad1157282be7182dc</id>
<content type='text'>
	Ensure fiber scheduler re-acquires mutex when interrupted from sleep. (#12158)

	[Bug #20907]
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
	Ensure fiber scheduler re-acquires mutex when interrupted from sleep. (#12158)

	[Bug #20907]
</pre>
</div>
</content>
</entry>
<entry>
<title>[DOC] Adjust some new features wording/examples. (#9183)</title>
<updated>2023-12-14T21:01:48+00:00</updated>
<author>
<name>Victor Shepelev</name>
<email>zverok.offline@gmail.com</email>
</author>
<published>2023-12-14T21:01:48+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=570d7b2c3e2ee39e07548dfe242b684ec794789d'/>
<id>570d7b2c3e2ee39e07548dfe242b684ec794789d</id>
<content type='text'>
* Reword Range#overlap? docs last paragraph.

* Docs: add explanation about Queue#freeze

* Docs: Add :rescue event docs for TracePoint

* Docs: Enhance Module#set_temporary_name documentation

* Docs: Slightly expand Process::Status deprecations

* Fix MatchData#named_captures rendering glitch

* Improve Dir.fchdir examples

* Adjust Refinement#target docs</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* Reword Range#overlap? docs last paragraph.

* Docs: add explanation about Queue#freeze

* Docs: Add :rescue event docs for TracePoint

* Docs: Enhance Module#set_temporary_name documentation

* Docs: Slightly expand Process::Status deprecations

* Fix MatchData#named_captures rendering glitch

* Improve Dir.fchdir examples

* Adjust Refinement#target docs</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>Make {Queue,SizedQueue}#freeze raise TypeError</title>
<updated>2023-09-27T18:57:50+00:00</updated>
<author>
<name>Jeremy Evans</name>
<email>code@jeremyevans.net</email>
</author>
<published>2023-09-26T22:31:55+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=62181e17da2db729eb6d95f6edff9e028ff557b6'/>
<id>62181e17da2db729eb6d95f6edff9e028ff557b6</id>
<content type='text'>
Fixes [Bug #17146]
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Fixes [Bug #17146]
</pre>
</div>
</content>
</entry>
<entry>
<title>Try default `gcc` 9.4.0 to see if it exhibits the same compiler bugs. (#8394)</title>
<updated>2023-09-08T08:44:46+00:00</updated>
<author>
<name>Samuel Williams</name>
<email>samuel.williams@oriontransfer.co.nz</email>
</author>
<published>2023-09-08T08:44:46+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=be21a056d229652ae5cf6926e96c1517aa43453f'/>
<id>be21a056d229652ae5cf6926e96c1517aa43453f</id>
<content type='text'>
* Revert "Extract `do_mutex_lock_check_interrupts` to try and fix `ppc64le`. (#8393)"

This reverts commit 5184b40dd4dc446660cd35c3e53896324e95b317.

* .travis.yml: Try default gcc 9.4.0 instead of gcc-10 in ppc64le and s390x.

Use gcc 9.4.0 instead of gcc-10 to avoid the current failures by a possible GCC
10 compiler bug in the Travis ppc64le and s390x cases. And it also aligns with
RubyCI Ubuntu ppc64le and s390x where the default gcc is used.

---------

Co-authored-by: Jun Aruga &lt;jaruga@ruby-lang.org&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* Revert "Extract `do_mutex_lock_check_interrupts` to try and fix `ppc64le`. (#8393)"

This reverts commit 5184b40dd4dc446660cd35c3e53896324e95b317.

* .travis.yml: Try default gcc 9.4.0 instead of gcc-10 in ppc64le and s390x.

Use gcc 9.4.0 instead of gcc-10 to avoid the current failures by a possible GCC
10 compiler bug in the Travis ppc64le and s390x cases. And it also aligns with
RubyCI Ubuntu ppc64le and s390x where the default gcc is used.

---------

Co-authored-by: Jun Aruga &lt;jaruga@ruby-lang.org&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>Extract `do_mutex_lock_check_interrupts` to try and fix `ppc64le`. (#8393)</title>
<updated>2023-09-07T12:32:54+00:00</updated>
<author>
<name>Samuel Williams</name>
<email>samuel.williams@oriontransfer.co.nz</email>
</author>
<published>2023-09-07T12:32:54+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=5184b40dd4dc446660cd35c3e53896324e95b317'/>
<id>5184b40dd4dc446660cd35c3e53896324e95b317</id>
<content type='text'>
We found some tests were hanging in `do_mutex_lock`, specifically the
fiber scheduler autoload test. After much investigation, it may be a code
generation bug. Because we didn't change the code, but only extracted it
into a separate function, and it appears to fix the problem.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
We found some tests were hanging in `do_mutex_lock`, specifically the
fiber scheduler autoload test. After much investigation, it may be a code
generation bug. Because we didn't change the code, but only extracted it
into a separate function, and it appears to fix the problem.</pre>
</div>
</content>
</entry>
<entry>
<title>[DOC] Add parenthetical to explain what FIFO abbrev means</title>
<updated>2023-07-13T12:39:31+00:00</updated>
<author>
<name>Shane Becker</name>
<email>veganstraightedge@gmail.com</email>
</author>
<published>2023-07-12T23:57:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=fff4773085bd70bf14ace146388dd0b9d80f244a'/>
<id>fff4773085bd70bf14ace146388dd0b9d80f244a</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>[DOC] Fix example code indentation from 3 to 2</title>
<updated>2023-07-13T05:22:47+00:00</updated>
<author>
<name>Shane Becker</name>
<email>veganstraightedge@gmail.com</email>
</author>
<published>2023-07-13T00:11:43+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=7524675330eaf96caba155852bb06b34b809b2a9'/>
<id>7524675330eaf96caba155852bb06b34b809b2a9</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Correctly clean up `keeping_mutexes` before resuming any other threads. (#7460)</title>
<updated>2023-03-07T07:23:00+00:00</updated>
<author>
<name>Samuel Williams</name>
<email>samuel.williams@oriontransfer.co.nz</email>
</author>
<published>2023-03-07T07:23:00+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=2c4b2053ca1884f058982fd46f2576bd887920b6'/>
<id>2c4b2053ca1884f058982fd46f2576bd887920b6</id>
<content type='text'>
It's possible (but very rare) to have a race condition between setting
`mutex-&gt;fiber = NULL` and `thread_mutex_remove(th, mutex)` which results
in the following bug:

```
[BUG] invalid keeping_mutexes: Attempt to unlock a mutex which is not locked
```

Fixes &lt;https://bugs.ruby-lang.org/issues/19480&gt;.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
It's possible (but very rare) to have a race condition between setting
`mutex-&gt;fiber = NULL` and `thread_mutex_remove(th, mutex)` which results
in the following bug:

```
[BUG] invalid keeping_mutexes: Attempt to unlock a mutex which is not locked
```

Fixes &lt;https://bugs.ruby-lang.org/issues/19480&gt;.</pre>
</div>
</content>
</entry>
</feed>
