Commit message (Collapse) | Author | Age | Files | Lines | |
---|---|---|---|---|---|
* | Ractor's "will" doesn't need copying. | Koichi Sasada | 2020-10-31 | 1 | -4/+4 |
| | | | | | | | | | | `r = Ractor.new{ expr }` generates the block return value from `expr` and we can get this value by `r.take`. Ractor.yield and Ractor#take passing values by copying on default. However, the block return value (we named it "will" in the code) is not referred from the Ractor because the Ractor is already dead. So we can pass the reference of "will" to another ractor without copying. We can apply same story for the propagated exception. | ||||
* | refactoring rb_ractor_confirm_belonging() | Koichi Sasada | 2020-10-21 | 1 | -3/+8 |
| | | | | | | rb_ractor_belonging() returns 0 only if it has sharable flag. rb_ractor_confirm_belonging() checks rb_ractor_shareable_p() if the belonging ractor id is different from current ractor id. | ||||
* | Ractor-safe rb_objspace_reachable_objects_from | Koichi Sasada | 2020-10-21 | 1 | -1/+6 |
| | | | | | | | | | | rb_objspace_reachable_objects_from(obj) is used to traverse all reachable objects from obj. This function modify objspace but it is not ractor-safe (thread-safe). This patch fix the problem. Strategy: (1) call GC mark process during_gc (2) call Ractor-local custom mark func when !during_gc | ||||
* | Some global variables can be accessed from ractors | Koichi Sasada | 2020-10-20 | 1 | -0/+2 |
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some global variables should be used from non-main Ractors. [Bug #17268] ```ruby # ractor-local (derived from created ractor): debug '$DEBUG' => $DEBUG, '$-d' => $-d, # ractor-local (derived from created ractor): verbose '$VERBOSE' => $VERBOSE, '$-w' => $-w, '$-W' => $-W, '$-v' => $-v, # process-local (readonly): other commandline parameters '$-p' => $-p, '$-l' => $-l, '$-a' => $-a, # process-local (readonly): getpid '$$' => $$, # thread local: process result '$?' => $?, # scope local: match '$~' => $~.inspect, '$&' => $&, '$`' => $`, '$\'' => $', '$+' => $+, '$1' => $1, # scope local: last line '$_' => $_, # scope local: last backtrace '$@' => $@, '$!' => $!, # ractor local: stdin, out, err '$stdin' => $stdin.inspect, '$stdout' => $stdout.inspect, '$stderr' => $stderr.inspect, ``` | ||||
* | Use language TLS specifier if it is possible. | Koichi Sasada | 2020-10-20 | 1 | -0/+8 |
| | | | | | | | To access TLS, it is faster to use language TLS specifier instead of using pthread_get/setspecific functions. Original proposal is: Use native thread locals. #3665 | ||||
* | change rb_ractor_queue to ring buffer | tompng | 2020-10-12 | 1 | -0/+1 |
| | |||||
* | Add Ractor#receive and Ractor.receive and use it in all places | Benoit Daloze | 2020-10-10 | 1 | -5/+5 |
| | | | | * Keep Ractor#recv/Ractor.recv as an alias for now. | ||||
* | Ractor#close_outgoping cancel Ractor.yield | Koichi Sasada | 2020-09-25 | 1 | -0/+1 |
| | | | | | | Ractor#close_outgoing should cancel waiting Ractor.yield. However, yield a value by the Ractor's block should not cancel (to recognize terminating Ractor, introduce rb_ractor_t::yield_atexit flag). | ||||
* | show object info to debug purpose. | Koichi Sasada | 2020-09-18 | 1 | -2/+3 |
| | |||||
* | Introduce Ractor mechanism for parallel execution | Koichi Sasada | 2020-09-03 | 1 | -0/+269 |
This commit introduces Ractor mechanism to run Ruby program in parallel. See doc/ractor.md for more details about Ractor. See ticket [Feature #17100] to see the implementation details and discussions. [Feature #17100] This commit does not complete the implementation. You can find many bugs on using Ractor. Also the specification will be changed so that this feature is experimental. You will see a warning when you make the first Ractor with `Ractor.new`. I hope this feature can help programmers from thread-safety issues. |