(forks) When do I need to lock variables?

[email protected] (Per Andreas Buer)
Newsgroups perl.ithreads
Organization -
Message-ID <[email protected]>
Hi.

I've playing around with forks and forks::shared for some time now - it
looks really nifty. In the past I've been spending too much time
emulating threads in Perl. :/

I am not quite sure when I need to lock. Is "$HASH{foo}++" safe? How
about "$foo = scalar keys %HASH"? Should a wrap access to shared lists
and hashed with tie and lock there?

-- 
There are only 10 different kinds of people in the world, 
those who understand binary, and those who don't.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.