[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Re: Ruby lacks atfork : The evil that lives in fork...

Yukihiro Matsumoto

10/6/2008 2:31:00 AM

Hi,

In message "Re: Ruby lacks atfork : The evil that lives in fork..."
on Mon, 6 Oct 2008 11:11:26 +0900, John Carter <john.carter@tait.co.nz> 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.