<feed xmlns='http://www.w3.org/2005/Atom'>
<title>ruby.git/bootstraptest, branch ruby_3_0</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) d0d6227a0da5925acf946a09191f172daf53baf2,fff1edf23ba28267bf57097c269f7fa87530e3fa: [Backport #17529]</title>
<updated>2022-03-21T07:52:05+00:00</updated>
<author>
<name>nagachika</name>
<email>nagachika@ruby-lang.org</email>
</author>
<published>2022-03-21T07:23:30+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=a72b7b898c69a116d754d599e8bb061761015255'/>
<id>a72b7b898c69a116d754d599e8bb061761015255</id>
<content type='text'>
	alen should be actions number on ractor_select()

	alen was number of rs, but it should be actions number
	(taking ractors + receiving + yielding).
	---
	 ractor.c | 13 ++++++-------
	 1 file changed, 6 insertions(+), 7 deletions(-)

	fix Ractor.yield(obj, move: true)

	Ractor.yield(obj, move: true) and
	Ractor.select(..., yield_value: obj, move: true) tried to yield a
	value with move semantices, but if the trial is faild, the obj
	should not become a moved object.

	To keep this rule, `wait_moving` wait status is introduced.

	New yield/take process:
	(1) If a ractor tried to yield (move:true), make taking racotr's
	    wait status `wait_moving` and make a moved object by
	    `ractor_move(obj)` and wakeup taking ractor.
	(2) If a ractor tried to take a message from a ractor waiting fo
	    yielding (move:true), wakeup the ractor and wait for (1).
	---
	 bootstraptest/test_ractor.rb | 25 +++++++++++++++
	 ractor.c                     | 73 +++++++++++++++++++++++++++++++++++---------
	 ractor_core.h                |  1 +
	 3 files changed, 84 insertions(+), 15 deletions(-)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
	alen should be actions number on ractor_select()

	alen was number of rs, but it should be actions number
	(taking ractors + receiving + yielding).
	---
	 ractor.c | 13 ++++++-------
	 1 file changed, 6 insertions(+), 7 deletions(-)

	fix Ractor.yield(obj, move: true)

	Ractor.yield(obj, move: true) and
	Ractor.select(..., yield_value: obj, move: true) tried to yield a
	value with move semantices, but if the trial is faild, the obj
	should not become a moved object.

	To keep this rule, `wait_moving` wait status is introduced.

	New yield/take process:
	(1) If a ractor tried to yield (move:true), make taking racotr's
	    wait status `wait_moving` and make a moved object by
	    `ractor_move(obj)` and wakeup taking ractor.
	(2) If a ractor tried to take a message from a ractor waiting fo
	    yielding (move:true), wakeup the ractor and wait for (1).
	---
	 bootstraptest/test_ractor.rb | 25 +++++++++++++++
	 ractor.c                     | 73 +++++++++++++++++++++++++++++++++++---------
	 ractor_core.h                |  1 +
	 3 files changed, 84 insertions(+), 15 deletions(-)
</pre>
</div>
</content>
</entry>
<entry>
<title>merge revision(s) 76228191474c76810043b294a74bbb2f1808b3d9: [Backport #18023]</title>
<updated>2021-10-16T04:28:27+00:00</updated>
<author>
<name>nagachika</name>
<email>nagachika@ruby-lang.org</email>
</author>
<published>2021-10-16T04:28:27+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=5427b08381fb0d644ec69d5aa94234f90a4fbed1'/>
<id>5427b08381fb0d644ec69d5aa94234f90a4fbed1</id>
<content type='text'>
	Fix Ractor.make_shareable changing locals for Procs

	env_copy() uses rb_ary_delete_at() with a loop counting up while
	iterating through the list of read only locals. rb_ary_delete_at() can
	shift elements in the array to an index lesser than the loop index,
	causing locals to be missed and set to Qfalse in the returned
	environment.

	Iterate through the locals in reverse instead, this way the shifting
	never happens for locals that are yet to be visited and we process all
	the locals in the array.

	[Bug #18023]
	---
	 bootstraptest/test_ractor.rb | 22 ++++++++++++++++++++++
	 vm.c                         |  2 +-
	 2 files changed, 23 insertions(+), 1 deletion(-)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
	Fix Ractor.make_shareable changing locals for Procs

	env_copy() uses rb_ary_delete_at() with a loop counting up while
	iterating through the list of read only locals. rb_ary_delete_at() can
	shift elements in the array to an index lesser than the loop index,
	causing locals to be missed and set to Qfalse in the returned
	environment.

	Iterate through the locals in reverse instead, this way the shifting
	never happens for locals that are yet to be visited and we process all
	the locals in the array.

	[Bug #18023]
	---
	 bootstraptest/test_ractor.rb | 22 ++++++++++++++++++++++
	 vm.c                         |  2 +-
	 2 files changed, 23 insertions(+), 1 deletion(-)
</pre>
</div>
</content>
</entry>
<entry>
<title>merge revision(s) bbedd29b6e98ef6e3fc2ce2b358d2b509b7cd1bb: [Backport #18117]</title>
<updated>2021-09-05T05:12:20+00:00</updated>
<author>
<name>nagachika</name>
<email>nagachika@ruby-lang.org</email>
</author>
<published>2021-09-05T05:12:20+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=3fb51aec5ba7decffdfc32e540262aaae6167a95'/>
<id>3fb51aec5ba7decffdfc32e540262aaae6167a95</id>
<content type='text'>
	[Bug #18117] Fix Ractor race condition with GC

	rb_objspace_reachable_objects_from requires that the GC not be active.
	Since the Ractor barrier is not executed for incremental sweeping,
	Ractor may call rb_objspace_reachable_objects_from after sweeping
	has started to share objects. This causes a crash that looks like
	the following:

	```
	&lt;internal:ractor&gt;:627: [BUG] rb_objspace_reachable_objects_from() is not supported while during_gc == true
	```

	Co-authored-by: Vinicius Stock &lt;vinicius.stock@shopify.com&gt;
	---
	 bootstraptest/test_ractor.rb | 15 +++++++++++++++
	 ractor.c                     | 12 ++++++++++--
	 2 files changed, 25 insertions(+), 2 deletions(-)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
	[Bug #18117] Fix Ractor race condition with GC

	rb_objspace_reachable_objects_from requires that the GC not be active.
	Since the Ractor barrier is not executed for incremental sweeping,
	Ractor may call rb_objspace_reachable_objects_from after sweeping
	has started to share objects. This causes a crash that looks like
	the following:

	```
	&lt;internal:ractor&gt;:627: [BUG] rb_objspace_reachable_objects_from() is not supported while during_gc == true
	```

	Co-authored-by: Vinicius Stock &lt;vinicius.stock@shopify.com&gt;
	---
	 bootstraptest/test_ractor.rb | 15 +++++++++++++++
	 ractor.c                     | 12 ++++++++++--
	 2 files changed, 25 insertions(+), 2 deletions(-)
</pre>
</div>
</content>
</entry>
<entry>
<title>merge revision(s) b3c53a8a885be8f5cc2b712798b0d2741c488ce4: [Backport #17672]</title>
<updated>2021-03-12T20:12:54+00:00</updated>
<author>
<name>NARUSE, Yui</name>
<email>naruse@airemix.jp</email>
</author>
<published>2021-03-12T20:12:54+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=6f9e007729d53fdbc22e37e52129ea5aa2556d0e'/>
<id>6f9e007729d53fdbc22e37e52129ea5aa2556d0e</id>
<content type='text'>
	Make Ractor stdio belonging to the Ractor [Bug #17672]

	Defer making ractor stdio until ractor started.
	Before ractor started, created objects belong to the caller ractor
	instead of the created ractor.
	---
	 bootstraptest/test_ractor.rb | 12 ++++++++++++
	 ractor.c                     |  9 ---------
	 thread.c                     |  9 +++++++++
	 3 files changed, 21 insertions(+), 9 deletions(-)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
	Make Ractor stdio belonging to the Ractor [Bug #17672]

	Defer making ractor stdio until ractor started.
	Before ractor started, created objects belong to the caller ractor
	instead of the created ractor.
	---
	 bootstraptest/test_ractor.rb | 12 ++++++++++++
	 ractor.c                     |  9 ---------
	 thread.c                     |  9 +++++++++
	 3 files changed, 21 insertions(+), 9 deletions(-)
</pre>
</div>
</content>
</entry>
<entry>
<title>merge revision(s) 63abb5c227e5c20d18d0debf699251da93ca64b5,34d02631e71209b12abb69d0114601027e485bc9,2adbf01ae14c0a4cf190b7c969b91726966a0e0f,3acc81d9e41b18380b9e0168fe2b5e5e0c727256: [Backport #17612]</title>
<updated>2021-03-12T20:11:30+00:00</updated>
<author>
<name>NARUSE, Yui</name>
<email>naruse@airemix.jp</email>
</author>
<published>2021-03-12T20:11:30+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=6bf32cbed8f3fd0b73b99737d671f833c594d800'/>
<id>6bf32cbed8f3fd0b73b99737d671f833c594d800</id>
<content type='text'>
	dtoa.c: make compilable independently

	Except for `-Dxmalloc=malloc -Dxfree=free`.
	---
	 missing/dtoa.c | 24 ++++++++++++++++++------
	 1 file changed, 18 insertions(+), 6 deletions(-)

	dtoa.c: constified

	clang seems to locate never modified local data in the const
	segment implicitly.
	---
	 missing/dtoa.c | 2 +-
	 1 file changed, 1 insertion(+), 1 deletion(-)

	dtoa.c: make thread-safe by using atomic CAS

	---
	 common.mk      |  2 ++
	 missing/dtoa.c | 75 ++++++++++++++++++++++++++++++++++++++++++----------------
	 util.c         |  1 +
	 3 files changed, 57 insertions(+), 21 deletions(-)

	Fixed race in dtoa [Bug #17612]

	Fixed the race condition when replacing `freelist` entry with its
	chained next element.  At acquiring an entry, hold the entry once
	with the special value, then release by replacing it with the next
	element again after acquired.  If another thread is holding the
	same entry at that time, spinning until the entry gets released.

	Co-Authored-By: Koichi Sasada &lt;ko1@atdot.net&gt;
	---
	 bootstraptest/test_ractor.rb | 11 +++++++++++
	 missing/dtoa.c               | 13 ++++++++++---
	 2 files changed, 21 insertions(+), 3 deletions(-)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
	dtoa.c: make compilable independently

	Except for `-Dxmalloc=malloc -Dxfree=free`.
	---
	 missing/dtoa.c | 24 ++++++++++++++++++------
	 1 file changed, 18 insertions(+), 6 deletions(-)

	dtoa.c: constified

	clang seems to locate never modified local data in the const
	segment implicitly.
	---
	 missing/dtoa.c | 2 +-
	 1 file changed, 1 insertion(+), 1 deletion(-)

	dtoa.c: make thread-safe by using atomic CAS

	---
	 common.mk      |  2 ++
	 missing/dtoa.c | 75 ++++++++++++++++++++++++++++++++++++++++++----------------
	 util.c         |  1 +
	 3 files changed, 57 insertions(+), 21 deletions(-)

	Fixed race in dtoa [Bug #17612]

	Fixed the race condition when replacing `freelist` entry with its
	chained next element.  At acquiring an entry, hold the entry once
	with the special value, then release by replacing it with the next
	element again after acquired.  If another thread is holding the
	same entry at that time, spinning until the entry gets released.

	Co-Authored-By: Koichi Sasada &lt;ko1@atdot.net&gt;
	---
	 bootstraptest/test_ractor.rb | 11 +++++++++++
	 missing/dtoa.c               | 13 ++++++++++---
	 2 files changed, 21 insertions(+), 3 deletions(-)
</pre>
</div>
</content>
</entry>
<entry>
<title>merge revision(s) 7b9476fbfab738d1eb01b4b4c4af9a1680513019: [Backport #17642]</title>
<updated>2021-03-11T15:32:56+00:00</updated>
<author>
<name>NARUSE, Yui</name>
<email>naruse@airemix.jp</email>
</author>
<published>2021-03-11T15:32:56+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=72c6497453f74f3398130d99fc610922f3995ae5'/>
<id>72c6497453f74f3398130d99fc610922f3995ae5</id>
<content type='text'>
	Ractor.allocate should not be allowed

	Ractor.allocate and Ractor#dup should not be allowed like Thread.
	[Bug #17642]
	---
	 bootstraptest/test_ractor.rb | 18 ++++++++++++++++++
	 ractor.c                     |  2 ++
	 2 files changed, 20 insertions(+)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
	Ractor.allocate should not be allowed

	Ractor.allocate and Ractor#dup should not be allowed like Thread.
	[Bug #17642]
	---
	 bootstraptest/test_ractor.rb | 18 ++++++++++++++++++
	 ractor.c                     |  2 ++
	 2 files changed, 20 insertions(+)
</pre>
</div>
</content>
</entry>
<entry>
<title>merge revision(s) 1cdae49d39fbaef654df487f168d1fb14a146d59: [Backport #17577]</title>
<updated>2021-02-02T10:09:40+00:00</updated>
<author>
<name>NARUSE, Yui</name>
<email>naruse@airemix.jp</email>
</author>
<published>2021-02-02T10:09:40+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=71b4638ca29a5d8a7d6f72e453513035d2096f47'/>
<id>71b4638ca29a5d8a7d6f72e453513035d2096f47</id>
<content type='text'>
	Implement NameError::message#clone for Ractor

	---
	 bootstraptest/test_ractor.rb   | 13 +++++++++++++
	 error.c                        | 35 +++++++++++++++++++++++++++++++++--
	 test/objspace/test_objspace.rb |  9 +++++++++
	 3 files changed, 55 insertions(+), 2 deletions(-)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
	Implement NameError::message#clone for Ractor

	---
	 bootstraptest/test_ractor.rb   | 13 +++++++++++++
	 error.c                        | 35 +++++++++++++++++++++++++++++++++--
	 test/objspace/test_objspace.rb |  9 +++++++++
	 3 files changed, 55 insertions(+), 2 deletions(-)
</pre>
</div>
</content>
</entry>
<entry>
<title>enable constant cache on ractors</title>
<updated>2021-01-13T08:06:16+00:00</updated>
<author>
<name>Koichi Sasada</name>
<email>ko1@atdot.net</email>
</author>
<published>2021-01-04T09:08:25+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=b93e16dc0f45069d4a5fcce20d5c4437e151f0a8'/>
<id>b93e16dc0f45069d4a5fcce20d5c4437e151f0a8</id>
<content type='text'>
constant cache `IC` is accessed by non-atomic manner and there are
thread-safety issues, so Ruby 3.0 disables to use const cache on
non-main ractors.

This patch enables it by introducing `imemo_constcache` and allocates
it by every re-fill of const cache like `imemo_callcache`.
[Bug #17510]

Now `IC` only has one entry `IC::entry` and it points to
`iseq_inline_constant_cache_entry`, managed by T_IMEMO object.

`IC` is atomic data structure so `rb_mjit_before_vm_ic_update()` and
`rb_mjit_after_vm_ic_update()` is not needed.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
constant cache `IC` is accessed by non-atomic manner and there are
thread-safety issues, so Ruby 3.0 disables to use const cache on
non-main ractors.

This patch enables it by introducing `imemo_constcache` and allocates
it by every re-fill of const cache like `imemo_callcache`.
[Bug #17510]

Now `IC` only has one entry `IC::entry` and it points to
`iseq_inline_constant_cache_entry`, managed by T_IMEMO object.

`IC` is atomic data structure so `rb_mjit_before_vm_ic_update()` and
`rb_mjit_after_vm_ic_update()` is not needed.
</pre>
</div>
</content>
</entry>
<entry>
<title>add Ractor.main</title>
<updated>2020-12-21T20:54:14+00:00</updated>
<author>
<name>Koichi Sasada</name>
<email>ko1@atdot.net</email>
</author>
<published>2020-12-21T17:22:51+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=d0e4ccbefcdd6032d0ae70bc54c9a4fb55d92576'/>
<id>d0e4ccbefcdd6032d0ae70bc54c9a4fb55d92576</id>
<content type='text'>
It returns main Ractor, like Thread.main.
[Feature #17418]
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
It returns main Ractor, like Thread.main.
[Feature #17418]
</pre>
</div>
</content>
</entry>
<entry>
<title>add Ractor#[]/#[]= for ractor local storage</title>
<updated>2020-12-21T20:26:32+00:00</updated>
<author>
<name>Koichi Sasada</name>
<email>ko1@atdot.net</email>
</author>
<published>2020-12-21T16:55:15+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=35471a948739ca13b85fe900871e081d553f68e6'/>
<id>35471a948739ca13b85fe900871e081d553f68e6</id>
<content type='text'>
This API is similar to plain old Thread#[]/Fiber#[] interface
with symbol key.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This API is similar to plain old Thread#[]/Fiber#[] interface
with symbol key.
</pre>
</div>
</content>
</entry>
</feed>
