You lose sequence.
Sorry, I hadn't realised that was a requirement. I'll think about that.
Can you do the same with hashes?
Yes. But be aware that if you don't lock the hash and insertions and deletions are going on, things can get a little strange. (Eg. Iterating the hash keys might return a key, but by the time you try to access the associate value, the key might have been deleted.
If the hash is essentially static -- only the values changing -- then only sharing the value scalars and applying locking to them individually can be much more efficient than locking the entire hash for every update.
In reply to Re^3: PerlIO file handle dup
by BrowserUk
in thread PerlIO file handle dup
by chris212
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |