NAME

Forks::Super::Sync::IPCSemaphore - Forks::Super sync object using SysV semaphores

SYNOPSIS

$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(...);
}

DESCRIPTION

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.

SEE ALSO

Forks::Super::Sync