Marty O'Brien > Forks-Super-0.67 > Forks::Super::Sync::IPCSemaphore

Download:
Forks-Super-0.67.tar.gz

Dependencies

Annotate this POD

CPAN RT

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

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

syntax highlighting: