# Locking is necessary when multiple workers update the same # element. The reason is that it may involve 2 trips to the # shared-manager process: fetch and store in this case. $mutex->enter( sub { $cnt += 1 } );