APM: More on Semaphores

Brian Michalk michalk at awpi.com
Wed Nov 27 16:20:36 CST 2002


Does the following work for anyone?

use IPC::SysV qw(IPC_PRIVATE IPC_CREAT IPC_STAT GETVAL );
my $nid1 = semget(IPC_PRIVATE, 1, IPC_CREAT | 0666);
# this returns an ID for me

my $nid2 = semget($nid1, 1, 0666);
# this one returns -1, but should have returned another handle to the
semaphore.

Maybe I'm missing something basic about how to use semaphores.




More information about the Austin mailing list