From: Eric Wong Date: 2018-03-28T21:48:25+00:00 Subject: [ruby-core:86371] Re: [Ruby trunk Bug#14634] Queue#push seems to crash after fork Eric Wong wrote: > benoit@sqreen.io wrote: > > That seem to have fixed it! Newbie question, do you plan to backport it to 2.5.x series also ? > > Thanks for the confirmation. I'm not too happy about the memory > increase for such objects; but I will work on that next month. > > naruse handles the backporting for 2.5 branch. I guess we missed the merge window for 2.5.1 Fwiw, I consider doing fork after creating threads to be dangerous and bug-prone in any language. AFAIK, pthreads implementations do not support it, even. Ruby currently can support this because of GVL; but I'm not sure how well we can support this pattern in the future. Just to reiterate: Thread.new; fork; # unsafe fork; Thread.new; # safe For the fork+exec case, we use vfork+exec via Process.spawn to ensure `backtick` and system() work inside Threads. (Similarly, POSIX has posix_spawn(3)). Unsubscribe: