Dunno, but safe_set does a lot of work for nothing. It assumes $h{$k} is already a reference to a shared var, so why does it create a new one?
sub safe_inc { lock ${$h{$k}}; ${$h{$k}} = ${$h{$k}} + 1; }
In reply to Re^5: Avoid Locking Entire Hashes
by ikegami
in thread Avoid Locking Entire Hashes
by jagan_1234
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |