File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -2178,10 +2178,11 @@ because g_called global variable should be synchronized by other
21782178ractor's threads. To avoid such data-race, some synchronization should
21792179be 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
You can’t perform that action at this time.
0 commit comments