From: Yukihiro Matsumoto Date: 2008-10-06T11:30:48+09:00 Subject: Re: Ruby lacks atfork : The evil that lives in fork... Hi, In message "Re: Ruby lacks atfork : The evil that lives in fork..." on Mon, 6 Oct 2008 11:11:26 +0900, John Carter writes: |Consider this simple usage of Thread and Process.... | |I use a mutex to block access to the $state variable when it is in |an "inconsistent" state. |When I Process.fork'ed I saw this.... |evil_fork.rb:39: Mon Oct 06 14:51:19 +1300 2008 Inconsistent Mutex unlocked | |ie. I could be accessing $state when it is in an inconsistent state |and the Mutex doesn't protect me. I am not sure what you meant here. It worked as I expected. You didn't wrap state(m) by synchronize, so that they are not mutually exclusive. What did you expect out of the script? matz.