Cari di Perl 
    Perl User Manual
Daftar Isi
(Sebelumnya) Get set of SysV semaphoresSysV shared memory operations (Berikutnya)
System V interprocess communication functions

SysV semaphore operations

Daftar Isi

  • semop KEY,OPSTRING

    Calls the System V IPC function semop(2) for semaphore operationssuch as signalling and waiting. OPSTRING must be a packed array ofsemop structures. Each semop structure can be generated withpack("s!3", $semnum, $semop, $semflag). The length of OPSTRING implies the number of semaphore operations. Returns true ifsuccessful, false on error. As an example, thefollowing code waits on semaphore $semnum of semaphore id $semid:

    1. $semop = pack("s!3", $semnum, -1, 0);
    2. die "Semaphore trouble: $!\n" unless semop($semid, $semop);

    To signal the semaphore, replace -1 with 1. See alsoSysV IPC in perlipc, IPC::SysV, and IPC::SysV::Semaphoredocumentation.

    Portability issues: semop in perlport.

 
Source : perldoc.perl.org - Official documentation for the Perl programming language
Site maintained by Jon Allen (JJ)     See the project page for more details
Documentation maintained by the Perl 5 Porters
(Sebelumnya) Get set of SysV semaphoresSysV shared memory operations (Berikutnya)