D
Dima
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?
#!/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?