Conversation
8d11ad1 to
389d709
Compare
|
I think methods from |
Agreed, so I marked those as Ractor-safe and the rest as Ractor-unsafe, and added tests. |
ext/etc/etc.c
Outdated
| rb_define_module_function(mEtc, "uname", etc_uname, 0); | ||
| rb_define_module_function(mEtc, "sysconf", etc_sysconf, 1); | ||
| rb_define_module_function(mEtc, "confstr", etc_confstr, 1); | ||
| rb_define_method(rb_cIO, "pathconf", io_pathconf, 1); |
There was a problem hiding this comment.
I think these 3 are probably MT-safe, and possibly also pathconf.
There was a problem hiding this comment.
Right, I'll add them.
And systmpdir seems fine too, all functions it calls take a buffer (for the path) so should be thread-safe.
I'll add a test calling these functions in parallel to try to ensure they are indeed thread/Ractor-safe.
Feel free to review more functions and mark them as safe later, I would just recommend to add them to test_ractor_parallel to check if they are indeed thread/Ractor-safe.
Actually sysconfdir doesn't work in a Ractor: https://github.com/ruby/ruby/actions/runs/14069312270/job/39399502142#step:12:941 because it tries to access RbConfig::CONFIG if |
|
Unfortunately there are more problems, which might be in Etc functions or Ractor bugs. I have seen this failure: Mentioned in https://ruby.slack.com/archives/C02A3SL0S/p1743044607025709 |
I think this makes sense for now to address the segfault.
Of course it can be improved later to use explicit locking.