ruby-changes:70803
From: Benoit <ko1@a...>
Date: Mon, 10 Jan 2022 21:09:41 +0900 (JST)
Subject: [ruby-changes:70803] ca97001a94 (master): Make the Ractor-safe section more fluent
https://git.ruby-lang.org/ruby.git/commit/?id=ca97001a94 From ca97001a945abf93dc5fbfe99f59f28c7d91e4c8 Mon Sep 17 00:00:00 2001 From: Benoit Daloze <eregontp@g...> Date: Mon, 10 Jan 2022 13:08:59 +0100 Subject: Make the Ractor-safe section more fluent --- doc/extension.rdoc | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/doc/extension.rdoc b/doc/extension.rdoc index b4b34b86de9..30800c2435f 100644 --- a/doc/extension.rdoc +++ b/doc/extension.rdoc @@ -2178,10 +2178,11 @@ because g_called global variable should be synchronized by other https://github.com/ruby/ruby/blob/trunk/doc/extension.rdoc#L2178 ractor's threads. To avoid such data-race, some synchronization should be used. Check include/ruby/thread_native.h and include/ruby/atomic.h. -On the Ractor mechanism, most of objects given by the method parameters -or the receiver are isolated by Ractor's boundary, it is easy to make -thread-safe code than usual thread-programming in general. For example, -we don't need to lock an array object to access the element of it. +With Ractors, all objects given as method parameters and the receiver (self) +are guaranteed to be from the current Ractor or to be shareable. As a +consequence, it is easier to make code ractor-safe than to make code generally +thread-safe. For example, we don't need to lock an array object to access the +element of it. (3) Check the thread-safety of any used library -- cgit v1.2.1 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/