<feed xmlns='http://www.w3.org/2005/Atom'>
<title>ruby.git/thread_win32.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) 055613fd868a8c94e43893f8c58a00cdd2a81f6d,127d7a35df10ee2bc99f44b888972b2c5361d84f,e2a9b87126d59e4766479a7aa12cf7a648f46506: [Backport #20447]</title>
<updated>2024-05-30T18:13:15+00:00</updated>
<author>
<name>Takashi Kokubun</name>
<email>takashikkbn@gmail.com</email>
</author>
<published>2024-05-30T18:13:15+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=b13cf49036f0a454063cde25807785adc00f8995'/>
<id>b13cf49036f0a454063cde25807785adc00f8995</id>
<content type='text'>
	Fix pointer incompatiblity

	Since the subsecond part is discarded, WIDEVAL to VALUE conversion is
	needed.

	Some functions are not used when `THREAD_MODEL=none`

	`rb_thread_sched_destroy` is not used now at all
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
	Fix pointer incompatiblity

	Since the subsecond part is discarded, WIDEVAL to VALUE conversion is
	needed.

	Some functions are not used when `THREAD_MODEL=none`

	`rb_thread_sched_destroy` is not used now at all
</pre>
</div>
</content>
</entry>
<entry>
<title>fix `native_thread_destroy()` timing</title>
<updated>2023-10-13T00:19:31+00:00</updated>
<author>
<name>Koichi Sasada</name>
<email>ko1@atdot.net</email>
</author>
<published>2023-10-12T16:14:17+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=cdb36dfe7ddb7cbd7ed95e84b24114c8869a7e5e'/>
<id>cdb36dfe7ddb7cbd7ed95e84b24114c8869a7e5e</id>
<content type='text'>
With M:N thread scheduler, the native thread (NT) related resources
should be freed when the NT is no longer needed. So the calling
`native_thread_destroy()` at the end of `is will be freed when
`thread_cleanup_func()` (at the end of Ruby thread) is not correct
timing. Call it when the corresponding Ruby thread is collected.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
With M:N thread scheduler, the native thread (NT) related resources
should be freed when the NT is no longer needed. So the calling
`native_thread_destroy()` at the end of `is will be freed when
`thread_cleanup_func()` (at the end of Ruby thread) is not correct
timing. Call it when the corresponding Ruby thread is collected.
</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>Compile disabled code for thread cache always</title>
<updated>2023-06-30T14:59:05+00:00</updated>
<author>
<name>Nobuyoshi Nakada</name>
<email>nobu@ruby-lang.org</email>
</author>
<published>2023-06-28T15:08:36+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=c1432a481615c7f1ad2c1426f0617f73599e2493'/>
<id>c1432a481615c7f1ad2c1426f0617f73599e2493</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>pass `th` to `thread_sched_to_waiting()`</title>
<updated>2023-03-31T09:50:10+00:00</updated>
<author>
<name>Koichi Sasada</name>
<email>ko1@atdot.net</email>
</author>
<published>2023-03-31T08:57:25+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=f803bcfc872b31faeb1b894e315175e410024cd5'/>
<id>f803bcfc872b31faeb1b894e315175e410024cd5</id>
<content type='text'>
for future extension
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
for future extension
</pre>
</div>
</content>
</entry>
<entry>
<title>Remove SIGCHLD `waidpid`. (#7527)</title>
<updated>2023-03-15T06:48:27+00:00</updated>
<author>
<name>Samuel Williams</name>
<email>samuel.williams@oriontransfer.co.nz</email>
</author>
<published>2023-03-15T06:48:27+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=7fd53eeb46db261bbc20025cdab70096245a5cbe'/>
<id>7fd53eeb46db261bbc20025cdab70096245a5cbe</id>
<content type='text'>
* Remove `waitpid_lock` and related code.

* Remove un-necessary test.

* Remove `rb_thread_sleep_interruptible` dead code.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* Remove `waitpid_lock` and related code.

* Remove un-necessary test.

* Remove `rb_thread_sleep_interruptible` dead code.</pre>
</div>
</content>
</entry>
<entry>
<title>Revert SIGCHLD changes to diagnose CI failures. (#7517)</title>
<updated>2023-03-14T07:07:59+00:00</updated>
<author>
<name>Samuel Williams</name>
<email>samuel.williams@oriontransfer.co.nz</email>
</author>
<published>2023-03-14T07:07:59+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=ac65ce16e904695ba45888d3fba641d12caf733a'/>
<id>ac65ce16e904695ba45888d3fba641d12caf733a</id>
<content type='text'>
* Revert "Remove special handling of `SIGCHLD`. (#7482)"

This reverts commit 44a0711eab7fbc71ac2c8ff489d8c53e97a8fe75.

* Revert "Remove prototypes for functions that are no longer used. (#7497)"

This reverts commit 4dce12bead3bfd91fd80b5e7195f7f540ffffacb.

* Revert "Remove SIGCHLD `waidpid`. (#7476)"

This reverts commit 1658e7d96696a656d9bd0a0c84c82cde86914ba2.

* Fix change to rjit variable name.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* Revert "Remove special handling of `SIGCHLD`. (#7482)"

This reverts commit 44a0711eab7fbc71ac2c8ff489d8c53e97a8fe75.

* Revert "Remove prototypes for functions that are no longer used. (#7497)"

This reverts commit 4dce12bead3bfd91fd80b5e7195f7f540ffffacb.

* Revert "Remove SIGCHLD `waidpid`. (#7476)"

This reverts commit 1658e7d96696a656d9bd0a0c84c82cde86914ba2.

* Fix change to rjit variable name.</pre>
</div>
</content>
</entry>
<entry>
<title>Remove SIGCHLD `waidpid`. (#7476)</title>
<updated>2023-03-09T03:05:47+00:00</updated>
<author>
<name>Samuel Williams</name>
<email>samuel.williams@oriontransfer.co.nz</email>
</author>
<published>2023-03-09T03:05:47+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=1658e7d96696a656d9bd0a0c84c82cde86914ba2'/>
<id>1658e7d96696a656d9bd0a0c84c82cde86914ba2</id>
<content type='text'>
* Remove `waitpid_lock` and related code.

* Remove un-necessary test.

* Remove `rb_thread_sleep_interruptible` dead code.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* Remove `waitpid_lock` and related code.

* Remove un-necessary test.

* Remove `rb_thread_sleep_interruptible` dead code.</pre>
</div>
</content>
</entry>
<entry>
<title>TestThreadInstrumentation: emit the EXIT event sooner</title>
<updated>2023-03-06T12:10:42+00:00</updated>
<author>
<name>Jean Boussier</name>
<email>byroot@ruby-lang.org</email>
</author>
<published>2023-02-06T08:29:39+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=704dd25812f34228a28f37c37757a675ad078a2b'/>
<id>704dd25812f34228a28f37c37757a675ad078a2b</id>
<content type='text'>
```
  1) Failure:
TestThreadInstrumentation#test_thread_instrumentation [/tmp/ruby/src/trunk-repeat20-asserts/test/-ext-/thread/test_instrumentation_api.rb:33]:
Call counters[4]: [3, 4, 4, 4, 0].
Expected 0 to be &gt; 0.
```

We fire the EXIT hook after the call to `thread_sched_to_dead` which
mean another thread might be running before the `EXIT` hook have been
executed.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
```
  1) Failure:
TestThreadInstrumentation#test_thread_instrumentation [/tmp/ruby/src/trunk-repeat20-asserts/test/-ext-/thread/test_instrumentation_api.rb:33]:
Call counters[4]: [3, 4, 4, 4, 0].
Expected 0 to be &gt; 0.
```

We fire the EXIT hook after the call to `thread_sched_to_dead` which
mean another thread might be running before the `EXIT` hook have been
executed.
</pre>
</div>
</content>
</entry>
<entry>
<title>Allow `RUBY_DEBUG_LOG` format to be empty</title>
<updated>2022-08-06T01:52:00+00:00</updated>
<author>
<name>Nobuyoshi Nakada</name>
<email>nobu@ruby-lang.org</email>
</author>
<published>2022-07-28T07:50:26+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=27173e3735ff509dc8d9cc9b410baff84adf57dc'/>
<id>27173e3735ff509dc8d9cc9b410baff84adf57dc</id>
<content type='text'>
GCC warns of empty format strings, perhaps because they have no
effects in printf() and there are better ways than sprintf().
However, ruby_debug_log() adds informations other than the format,
this warning is not the case.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
GCC warns of empty format strings, perhaps because they have no
effects in printf() and there are better ways than sprintf().
However, ruby_debug_log() adds informations other than the format,
this warning is not the case.
</pre>
</div>
</content>
</entry>
</feed>
