in reply to Re^4: Avoid Locking Entire Hashes
in thread Avoid Locking Entire Hashes
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; }
|
|---|