Forks::Super::Sync::IPCSemaphore - Forks::Super sync object using SysV semaphores
$lock = Forks::Super::Sync->new(implementation => 'IPCSemaphore', ...); $pid=fork(); $lock->releaseAfterFork(); if ($pid == 0) { # child code $lock->acquire(...); $lock->release(...); } else { $lock->acquire(...); $lock->release(...); }
IPC synchronization object implemented with SysV semaphores.
Advantages: fast, doesn't create files or use filehandles
Disadvantages: Unix only. Gets complicated when a child process dies without releasing its locks.
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.