Forks::Super::Sync::Semaphlock - Forks::Super sync object using advisory file locking
$lock = Forks::Super::Sync->new(implementation => 'Semaphlock', ...); $pid=fork(); $lock->releaseAfterFork(); if ($pid == 0) { # child code $lock->acquire(...); $lock->release(...); } else { $lock->acquire(...); $lock->release(...); }
IPC synchronization object implemented with advisory file locking. Useful as a last resort if your system does not have good support for semaphores or shared memory.
Advantages: should work anywhere that implements "flock" in perlfunc.
Disadvantages: creates files, IPC litter. Uses precious filehandles.
Forks::Super::Sync
To install Forks::Super, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Forks::Super
CPAN shell
perl -MCPAN -e shell install Forks::Super
For more information on module installation, please visit the detailed CPAN module installation guide.