The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Forks::Super::Sync::Semaphlock - Forks::Super sync object using advisory file locking

SYNOPSIS

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

DESCRIPTION

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.

SEE ALSO

Forks::Super::Sync