"be consistent" | |
PerlMonks |
Re^2: Program Design Around Threadsby 7stud (Deacon) |
on Mar 06, 2013 at 06:38 UTC ( [id://1021960]=note: print w/replies, xml ) | Need Help?? |
When they have it, they lock the shared hash and add the content (or an error messgae) as the value, keyed by the id. The outputter thread monitors this hash waiting for the appearance of the next id in sequence, and when it appears, they lock the hash; write it to the file and then delete it. What is the point of the locks? The id's are unique, right? As far as I can tell, it doesn't matter if every thread--including the outputter--all modify the hash at the same time.
In Section
Seekers of Perl Wisdom
|
|