For shared objects, the OO interface has the least overhead. MCE::Shared provides on-demand dereferencing for array and hash-like behavior. In that case, a mutex is needed whenever dereferencing involves a fetch and store (equals 2 IPC trips to the shared-manager). Regarding the OO interface, there is a single entry point to the shared-manager process. This is why a mutex isn't needed when accessing shared objects via the OO interface, unless wanting a mutex around updating two or more shared objects.
sub task { our $mutex; $mutex->lock; # not necessary when accessing shared-objects via th +e OO interface $result->push(shift); $mutex->unlock; $mutex->lock; # necessary if dereferencing involves fetch and stor +e behind TIE push @{ $result }, shift; $mutex->unlock; }
In reply to Re: Where does the 6th process come from?
by marioroy
in thread Where does the 6th process come from? [SOLVED]
by karlgoethebier
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |