Your skill will accomplish what the force of many cannot |
|
PerlMonks |
Re^2: threads::shared variables not really shared... or are they?by renodino (Curate) |
on Mar 08, 2008 at 03:21 UTC ( [id://672931]=note: print w/replies, xml ) | Need Help?? |
The original added 100 1Mbyte strings to @a.
Your example adds 50 * 10 = 500 1Mbyte strings to @a.
Also, each thread will create a 1Mbyte private scalar;
the original only created a single big string.
(The lack of locks is a bit troubling, but the aforementioned global interpretter lock is probably keeping your example out of trouble) Perl Contrarian & SQL fanboy
In Section
Seekers of Perl Wisdom
|
|