<feed xmlns='http://www.w3.org/2005/Atom'>
<title>ruby.git/thread.c, branch v3_2_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) 78d9fe69479d32214a52ad7291c3973f1b6b7f6f, 04729fe68dceddab045be7324e26c2bb15aa62c7: [Backport #20286] [Backport #20286]</title>
<updated>2024-07-06T04:35:22+00:00</updated>
<author>
<name>nagachika</name>
<email>nagachika@ruby-lang.org</email>
</author>
<published>2024-07-06T04:33:24+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=89de66dbb0d8454c9d69faa331d6e35f8b315cce'/>
<id>89de66dbb0d8454c9d69faa331d6e35f8b315cce</id>
<content type='text'>
	Ensure that exiting thread invokes end-of-life behaviour. (#10039)

	Fix exception handling in `rb_fiber_scheduler_set`. (#10042)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
	Ensure that exiting thread invokes end-of-life behaviour. (#10039)

	Fix exception handling in `rb_fiber_scheduler_set`. (#10042)
</pre>
</div>
</content>
</entry>
<entry>
<title>merge revision(s) a7ff264477105b5dc0ade6facad4176a1b73df0b: [Backport #20393]</title>
<updated>2024-07-06T04:26:26+00:00</updated>
<author>
<name>nagachika</name>
<email>nagachika@ruby-lang.org</email>
</author>
<published>2024-07-06T04:26:26+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=5577e5d396cc8f062833b67d6280db6cc8501e7a'/>
<id>5577e5d396cc8f062833b67d6280db6cc8501e7a</id>
<content type='text'>
	Don't clear pending interrupts in the parent process. (#10365)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
	Don't clear pending interrupts in the parent process. (#10365)
</pre>
</div>
</content>
</entry>
<entry>
<title>Inline RB_VM_SAVE_MACHINE_CONTEXT into BLOCKING_REGION</title>
<updated>2024-06-15T04:05:25+00:00</updated>
<author>
<name>KJ Tsanaktsidis</name>
<email>ktsanaktsidis@zendesk.com</email>
</author>
<published>2024-05-18T09:37:49+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=2f010f31f1887ad0f429709a2906fc5a4dae8e87'/>
<id>2f010f31f1887ad0f429709a2906fc5a4dae8e87</id>
<content type='text'>
There's an exhaustive explanation of this in the linked redmine bug, but
the short version is as follows:

blocking_region_begin can spill callee-saved registers to the stack for
its own use. That means they're not saved to ec-&gt;machine by the call to
setjmp, since by that point they're already on the stack and new,
different values are in the real registers. ec-&gt;machine's end-of-stack
pointer is also bumped to accomodate this, BUT, after
blocking_region_begin returns, that points past the end of the stack!

As far as C is concerned, that's fine; the callee-saved registers are
restored when blocking_region_begin returns. But, if another thread
triggers GC, it is relying on finding references to Ruby objects by
walking the stack region pointed to by ec-&gt;machine.

If the C code in exec; subsequently does things that use that stack
memory, then the value will be overwritten and the GC might prematurely
collect something it shouldn't.

[Bug #20493]
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
There's an exhaustive explanation of this in the linked redmine bug, but
the short version is as follows:

blocking_region_begin can spill callee-saved registers to the stack for
its own use. That means they're not saved to ec-&gt;machine by the call to
setjmp, since by that point they're already on the stack and new,
different values are in the real registers. ec-&gt;machine's end-of-stack
pointer is also bumped to accomodate this, BUT, after
blocking_region_begin returns, that points past the end of the stack!

As far as C is concerned, that's fine; the callee-saved registers are
restored when blocking_region_begin returns. But, if another thread
triggers GC, it is relying on finding references to Ruby objects by
walking the stack region pointed to by ec-&gt;machine.

If the C code in exec; subsequently does things that use that stack
memory, then the value will be overwritten and the GC might prematurely
collect something it shouldn't.

[Bug #20493]
</pre>
</div>
</content>
</entry>
<entry>
<title>merge revision(s) 0402193723647b8c4f57b1453fe2192ad2788d12: [Backport #19709]</title>
<updated>2023-07-22T04:08:16+00:00</updated>
<author>
<name>nagachika</name>
<email>nagachika@ruby-lang.org</email>
</author>
<published>2023-07-22T04:08:16+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=a3911b965f094f07080cf7adb22ee5e2e8555d86'/>
<id>a3911b965f094f07080cf7adb22ee5e2e8555d86</id>
<content type='text'>
	Fix `Thread#join(timeout)` when running inside the fiber scheduler.
	 (#7903)

	---
	 test/fiber/test_thread.rb | 22 ++++++++++++++++++++++
	 thread.c                  |  5 +++++
	 2 files changed, 27 insertions(+)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
	Fix `Thread#join(timeout)` when running inside the fiber scheduler.
	 (#7903)

	---
	 test/fiber/test_thread.rb | 22 ++++++++++++++++++++++
	 thread.c                  |  5 +++++
	 2 files changed, 27 insertions(+)
</pre>
</div>
</content>
</entry>
<entry>
<title>merge revision(s) 8ce2fb9bbbaea14737c84385b1573f743a30f773,3a0f6ce1d31eefd8af01b50f3632a64d64e8f8c1: [Backport #19415]</title>
<updated>2023-03-02T00:29:38+00:00</updated>
<author>
<name>NARUSE, Yui</name>
<email>naruse@airemix.jp</email>
</author>
<published>2023-03-02T00:28:58+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=53f6173cfc085a7422b4a76c85e6c35969209327'/>
<id>53f6173cfc085a7422b4a76c85e6c35969209327</id>
<content type='text'>
	Only emit circular dependency warning for owned thread shields [Bug
	 #19415]

	If multiple threads attemps to load the same file concurrently
	it's not a circular dependency issue.

	So we check that the existing ThreadShield is owner by the current
	fiber before warning about circular dependencies.
	---
	 internal/thread.h                                     |  1 +
	 load.c                                                |  3 ++-
	 spec/ruby/core/kernel/shared/require.rb               | 11 +++++++++++
	 spec/ruby/fixtures/code/concurrent_require_fixture.rb |  4 ++++
	 test/ruby/test_require.rb                             |  3 ---
	 thread.c                                              | 11 +++++++++++
	 6 files changed, 29 insertions(+), 4 deletions(-)
	 create mode 100644 spec/ruby/fixtures/code/concurrent_require_fixture.rb

	Use Thread.pass until thread.stop? to wait for thread to block

	[Bug #19415]

	It should be more reliable
	---
	 spec/ruby/fixtures/code/concurrent_require_fixture.rb | 2 +-
	 1 file changed, 1 insertion(+), 1 deletion(-)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
	Only emit circular dependency warning for owned thread shields [Bug
	 #19415]

	If multiple threads attemps to load the same file concurrently
	it's not a circular dependency issue.

	So we check that the existing ThreadShield is owner by the current
	fiber before warning about circular dependencies.
	---
	 internal/thread.h                                     |  1 +
	 load.c                                                |  3 ++-
	 spec/ruby/core/kernel/shared/require.rb               | 11 +++++++++++
	 spec/ruby/fixtures/code/concurrent_require_fixture.rb |  4 ++++
	 test/ruby/test_require.rb                             |  3 ---
	 thread.c                                              | 11 +++++++++++
	 6 files changed, 29 insertions(+), 4 deletions(-)
	 create mode 100644 spec/ruby/fixtures/code/concurrent_require_fixture.rb

	Use Thread.pass until thread.stop? to wait for thread to block

	[Bug #19415]

	It should be more reliable
	---
	 spec/ruby/fixtures/code/concurrent_require_fixture.rb | 2 +-
	 1 file changed, 1 insertion(+), 1 deletion(-)
</pre>
</div>
</content>
</entry>
<entry>
<title>Introduce `Fiber#storage` for inheritable fiber-scoped variables. (#6612)</title>
<updated>2022-12-01T10:00:33+00:00</updated>
<author>
<name>Samuel Williams</name>
<email>samuel.williams@oriontransfer.co.nz</email>
</author>
<published>2022-12-01T10:00:33+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=0436f1e15a8e79ffef5ea412ac1312cbf9f063e6'/>
<id>0436f1e15a8e79ffef5ea412ac1312cbf9f063e6</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Using UNDEF_P macro</title>
<updated>2022-11-16T09:58:33+00:00</updated>
<author>
<name>S-H-GAMELINKS</name>
<email>gamelinks007@gmail.com</email>
</author>
<published>2022-11-15T04:24:08+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=1f4f6c9832d83e7ebd65ccf4e95cef358b3512c6'/>
<id>1f4f6c9832d83e7ebd65ccf4e95cef358b3512c6</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>
<entry>
<title>Avoid missed wakeup with fiber scheduler and Fiber.blocking. (#6588)</title>
<updated>2022-10-20T00:38:52+00:00</updated>
<author>
<name>Samuel Williams</name>
<email>samuel.williams@oriontransfer.co.nz</email>
</author>
<published>2022-10-20T00:38:52+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=7f175e564875b011efb43537907867dd08d659e8'/>
<id>7f175e564875b011efb43537907867dd08d659e8</id>
<content type='text'>
* Ensure that blocked fibers don't prevent valid wakeups.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* Ensure that blocked fibers don't prevent valid wakeups.</pre>
</div>
</content>
</entry>
<entry>
<title>Add IO#timeout attribute and use it for blocking IO operations. (#5653)</title>
<updated>2022-10-07T08:48:38+00:00</updated>
<author>
<name>Samuel Williams</name>
<email>samuel.williams@oriontransfer.co.nz</email>
</author>
<published>2022-10-07T08:48:38+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=e4f91bbdbaa6ab3125f24967414ac5300bb244f5'/>
<id>e4f91bbdbaa6ab3125f24967414ac5300bb244f5</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
</feed>
