Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Why not work POSIX::RT:Semaphore

12 views
Skip to first unread message

Dima

unread,
Mar 24, 2005, 8:45:44 AM3/24/05
to
This is my simple code

#!/usr/local/bin/perl
use threads;
use threads::shared;
use POSIX::RT::Semaphore;

$sem = POSIX::RT::Semaphore->init(0, 0);

my $pid = fork;
if ( $pid == 0 )
{
$sem->wait;
print "CODE2\n";
exit;
}

print "CODE1\n";
$sem->post;


Why I see only CODE1???
Why after post in parent process semaphore value in child process was't changed?

0 new messages