Bug #6699

rb_barrier_wait() gets blocked when running within a Thread.new { }

Added by Iñaki Baz Castillo over 3 years ago. Updated about 3 years ago.

ruby -v:ruby 2.0.0dev (2012-07-03 trunk 36272) [x86_64-linux] Backport:


In my Ruby C extension I use rb_barrier_wait(MY_BARRIER) in a method. It works perfectly but I've realized of a case in which it gets

Thread.new do

In this case the C function rb_barrier_wait(MY_BARRIER) gets blocked (note that I don't call if from other place). So this seems a conflict
of the new Thread and rb_barrier_wait(), it seems that they both try to access to the same shared resource. Is it the expected behavior?


#1 Updated by Motohiro KOSAKI over 3 years ago

Please don't use rb_barrier_wait(). It doesn't have barrier semantics. Moreover, It is not a public API. We might remove it in future release.

#2 Updated by Iñaki Baz Castillo over 3 years ago

Thanks for the clarification.

#3 Updated by Motohiro KOSAKI about 3 years ago

  • Status changed from Open to Closed

Also available in: Atom PDF