From: Tanaka Akira Date: 2009-07-27T16:16:05+09:00 Subject: [ruby-core:24570] Re: [Bug #1525] Deadlock in Ruby 1.9's VM caused by ConditionVariable.wait and fork? In article <4A6C5608.1080202@plan99.net>, Hongli Lai writes: > In any case, not being able to create threads or doing anything > complicated in child processes is a serious limitation. This makes > forking-without-exec in Ruby 1.9 as good as useless. Even > forking-with-exec is dangerous now. For example, suppose that the child > process creates a command string to pass to exec(), and creating this > command string involves malloc()ing memory. Even this isn't safe anymore. Even worse, YARV uses a timer thread. It is an internal native thread which is always exists. When Kernel#fork is used, YARV implicitly start a timer thread in the child process. It is dangerous. Process.spawn helps the forking-with-exec situaion. It creates a new process. Bunch of process attributes are specifiable but no Ruby script is run in the child process. So a timer thread is not required in the child process. I'm not sure we can help forking-without-exec situation. -- Tanaka Akira