From: SASADA Koichi Date: 2012-09-25T16:51:58+09:00 Subject: [ruby-core:47692] Re: [ruby-trunk - Bug #6822] Race Condition with Fiber and Process (2012/09/22 15:45), MartinBosslet (Martin Bosslet) wrote: >> > No. You don't need Mutex at all. >> > You only need to use variables (such as global variables). > Now I'm confused. How would I write the example code without getting the FiberErrors? Since I have no control over when a child process exits, I can't control when the 'trap(:CHLD)' block calls Fiber#resume, no? I thought I would have to do some form of manual synchronization there, to avoid the race condition. Sorry to bug you :) Now, I understand your issue. This is not a Fiber problem, but concurrency problem with signal. I recommend that you shouldn't use Fiber.resume in a trap handler. In the trap handler, you should only set a flag and make flag sense in main. -- // SASADA Koichi at atdot dot net