Skip to content

Commit ca97001

Browse files
committed
Make the Ractor-safe section more fluent
1 parent b4d0d07 commit ca97001

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

doc/extension.rdoc

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2178,10 +2178,11 @@ because g_called global variable should be synchronized by other
21782178
ractor's threads. To avoid such data-race, some synchronization should
21792179
be used. Check include/ruby/thread_native.h and include/ruby/atomic.h.
21802180

2181-
On the Ractor mechanism, most of objects given by the method parameters
2182-
or the receiver are isolated by Ractor's boundary, it is easy to make
2183-
thread-safe code than usual thread-programming in general. For example,
2184-
we don't need to lock an array object to access the element of it.
2181+
With Ractors, all objects given as method parameters and the receiver (self)
2182+
are guaranteed to be from the current Ractor or to be shareable. As a
2183+
consequence, it is easier to make code ractor-safe than to make code generally
2184+
thread-safe. For example, we don't need to lock an array object to access the
2185+
element of it.
21852186

21862187
(3) Check the thread-safety of any used library
21872188

0 commit comments

Comments
 (0)