Perl-Sensitive Sunglasses | |
PerlMonks |
Re: Threads: why locking is required when using shared variablesby monarch (Priest) |
on Oct 20, 2006 at 13:58 UTC ( [id://579585]=note: print w/replies, xml ) | Need Help?? |
This is a great introduction and, certainly, locking of shared variables is essential learning and understanding for anyone who is going to be using threads.
Perhaps it is worth mentioning, in this particular case, that the lock function doesn't need an explicit unlock. Rather, a locked variable becomes unlocked when the code execution exits the current scope.
In Section
Tutorials
|
|