<feed xmlns='http://www.w3.org/2005/Atom'>
<title>ruby.git/ractor.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) e94a2f691d67ad98be9036e76c765fcfa7d22552: [Backport #21638]</title>
<updated>2025-10-18T02:20:54+00:00</updated>
<author>
<name>nagachika</name>
<email>nagachika@ruby-lang.org</email>
</author>
<published>2025-10-18T02:20:54+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=e526fbe770909974f610b7a2a00bd8d5dd045f1f'/>
<id>e526fbe770909974f610b7a2a00bd8d5dd045f1f</id>
<content type='text'>
	[PATCH] [Bug #21638] Mark ractor-local `$VERBOSE` and `$DEBUG`

	https://github.com/sampersand/blog/blob/master/the%20-s%20flag.md#the-segfault
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
	[PATCH] [Bug #21638] Mark ractor-local `$VERBOSE` and `$DEBUG`

	https://github.com/sampersand/blog/blob/master/the%20-s%20flag.md#the-segfault
</pre>
</div>
</content>
</entry>
<entry>
<title>merge revision(s) ef276858d9295208add48e27208c69184dc50472: [Backport #20197] (#10296)</title>
<updated>2024-03-20T11:05:21+00:00</updated>
<author>
<name>NARUSE, Yui</name>
<email>nurse@users.noreply.github.com</email>
</author>
<published>2024-03-20T11:05:21+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=0793cbbfde261f4fc9bf7045594d62a21e391811'/>
<id>0793cbbfde261f4fc9bf7045594d62a21e391811</id>
<content type='text'>
Trigger postponed jobs on running_ec if that is available

	Currently, any postponed job triggered from a non-ruby thread gets sent
	to the main thread, but if the main thread is sleeping it won't be
	checking ints. Instead, we should try and interrupt running_ec if that's
	possible, and only fall back to the main thread if it's not.

	[Bug #20197]
	---
	 ractor.c | 16 ++++++++++++++++
	 1 file changed, 16 insertions(+)</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Trigger postponed jobs on running_ec if that is available

	Currently, any postponed job triggered from a non-ruby thread gets sent
	to the main thread, but if the main thread is sleeping it won't be
	checking ints. Instead, we should try and interrupt running_ec if that's
	possible, and only fall back to the main thread if it's not.

	[Bug #20197]
	---
	 ractor.c | 16 ++++++++++++++++
	 1 file changed, 16 insertions(+)</pre>
</div>
</content>
</entry>
<entry>
<title>Use main_thread-&gt;ec from rb_vm_main_ractor_ec</title>
<updated>2023-12-21T17:17:22+00:00</updated>
<author>
<name>John Hawthorn</name>
<email>john@hawthorn.email</email>
</author>
<published>2023-12-20T23:29:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=1f0304218cf00e05a4a126196676ba221ebf91f6'/>
<id>1f0304218cf00e05a4a126196676ba221ebf91f6</id>
<content type='text'>
rb_vm_main_ractor_ec was introduced to allow rb_postponed_job_* to work
when fired on non-Ruby threads, which have no EC set, and that is its
only use.

When RUBY_MN_THREADS=1 is set ractor-&gt;threads.running_ec is NULL when
the shared thread is sleeping. This instead grabs the EC directly from
the main thread which seems to always be set.

Fixes [Bug #20016]

Co-authored-by: Dustin Brown &lt;dbrown9@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
rb_vm_main_ractor_ec was introduced to allow rb_postponed_job_* to work
when fired on non-Ruby threads, which have no EC set, and that is its
only use.

When RUBY_MN_THREADS=1 is set ractor-&gt;threads.running_ec is NULL when
the shared thread is sleeping. This instead grabs the EC directly from
the main thread which seems to always be set.

Fixes [Bug #20016]

Co-authored-by: Dustin Brown &lt;dbrown9@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>moved object should not have a shape ID</title>
<updated>2023-12-19T22:04:32+00:00</updated>
<author>
<name>Koichi Sasada</name>
<email>ko1@atdot.net</email>
</author>
<published>2023-12-19T18:45:41+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=054f56fd3e5bf84e5443896fd1f4e439c2773c60'/>
<id>054f56fd3e5bf84e5443896fd1f4e439c2773c60</id>
<content type='text'>
fix [Bug #19917]
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
fix [Bug #19917]
</pre>
</div>
</content>
</entry>
<entry>
<title>remove `Ractor::Selector` from Ruby level</title>
<updated>2023-12-15T16:00:01+00:00</updated>
<author>
<name>Koichi Sasada</name>
<email>ko1@atdot.net</email>
</author>
<published>2023-12-15T09:25:12+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=c9a9b8036c71974ab938a8bb3d6f095d4a318a8e'/>
<id>c9a9b8036c71974ab938a8bb3d6f095d4a318a8e</id>
<content type='text'>
`Ractor::Selector` is not approved by Matz so remove it from
Ruby-level.

The implementation is used by `Ractor.select` so most of implementation
was remaind and calling `rb_init_ractor_selector()`, `Ractor::Selector`
will be defined. I will provide `ractor-selector` gem to try it.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
`Ractor::Selector` is not approved by Matz so remove it from
Ruby-level.

The implementation is used by `Ractor.select` so most of implementation
was remaind and calling `rb_init_ractor_selector()`, `Ractor::Selector`
will be defined. I will provide `ractor-selector` gem to try it.
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix Ractor sharing for too complex Objects</title>
<updated>2023-11-28T22:43:22+00:00</updated>
<author>
<name>Peter Zhu</name>
<email>peter@peterzhu.ca</email>
</author>
<published>2023-11-28T14:26:55+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=10f44dfeff631e4298461493514229c0d744bebe'/>
<id>10f44dfeff631e4298461493514229c0d744bebe</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix Ractor sharing for too complex generic ivars</title>
<updated>2023-11-28T22:43:22+00:00</updated>
<author>
<name>Peter Zhu</name>
<email>peter@peterzhu.ca</email>
</author>
<published>2023-11-28T14:26:41+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=6eb5a9cf8f99b64d97d26b41011c03b846317d3e'/>
<id>6eb5a9cf8f99b64d97d26b41011c03b846317d3e</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Add ST table to gen_ivtbl for complex shapes</title>
<updated>2023-10-31T16:07:54+00:00</updated>
<author>
<name>Peter Zhu</name>
<email>peter@peterzhu.ca</email>
</author>
<published>2023-10-31T13:38:35+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=e2d950733ee274e577813b5a4e930f617c60634f'/>
<id>e2d950733ee274e577813b5a4e930f617c60634f</id>
<content type='text'>
On 32-bit systems, we must store the shape ID in the gen_ivtbl to not
lose the shape. If we directly store the ST table into the generic
ivar table, then we lose the shape. This makes it impossible to
determine the shape of the object and whether it is too complex or not.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
On 32-bit systems, we must store the shape ID in the gen_ivtbl to not
lose the shape. If we directly store the ST table into the generic
ivar table, then we lose the shape. This makes it impossible to
determine the shape of the object and whether it is too complex or not.
</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>[Feature #19730] Remove transient heap</title>
<updated>2023-07-13T13:27:33+00:00</updated>
<author>
<name>Peter Zhu</name>
<email>peter@peterzhu.ca</email>
</author>
<published>2023-06-13T20:19:33+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=1e7b67f73370056c7521306b9f037b6cbccf640d'/>
<id>1e7b67f73370056c7521306b9f037b6cbccf640d</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
</feed>
