Perl-Sensitive Sunglasses | |
PerlMonks |
Re^5: Printing to STDERR causes deadlocks.by bmann (Priest) |
on Apr 27, 2005 at 01:50 UTC ( [id://451822]=note: print w/replies, xml ) | Need Help?? |
Okay, I've run it multiple times. It hangs for me too, but randomly - about 1 out of 25 runs - more often if the machine is under heavy load. I moved the warn statements after the lock in both subs and moved the "warn m-processing" above the signal to reduce the time the variable was unlocked. That seemed to help, but how do we quantify it? The $done race was not the only one. Looking at the TRACE output, the warn statements don't get executed uniformly. I guess hat's to be expected, since the threads run asynchronously. However, when it hangs, I see one of two things: a missed signal or a signal being raised when the other thread isn't waiting.
Now threads::shared says the following about the second condition: Uh... what does it mean "with care"? Two more random notes -
In Section
Seekers of Perl Wisdom
|
|