Marty O'Brien > Forks-Super-0.68 > Forks::Super::Sync::Semaphlock

Download:
Forks-Super-0.68.tar.gz

Dependencies

Annotate this POD

CPAN RT

Open  0
Stalled  1
View/Report Bugs
Module Version: 0.68   Source   Latest Release: Forks-Super-0.73

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

syntax highlighting: