Why not work POSIX::RT:Semaphore

Discussion in 'Perl' started by Dima, Mar 24, 2005.

  1. Dima

    Dima Guest

    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?
    Dima, Mar 24, 2005
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Horace Nunley

    why why why does function not work

    Horace Nunley, Sep 27, 2006, in forum: ASP .Net
    Replies:
    1
    Views:
    447
    =?Utf-8?B?UGV0ZXIgQnJvbWJlcmcgW0MjIE1WUF0=?=
    Sep 27, 2006
  2. Mr. SweatyFinger

    why why why why why

    Mr. SweatyFinger, Nov 28, 2006, in forum: ASP .Net
    Replies:
    4
    Views:
    855
    Mark Rae
    Dec 21, 2006
  3. Mr. SweatyFinger
    Replies:
    2
    Views:
    1,756
    Smokey Grindel
    Dec 2, 2006
  4. techi_C
    Replies:
    2
    Views:
    1,393
    Richard Bos
    Aug 10, 2006
  5. Neal Becker

    posix semaphore support?

    Neal Becker, Aug 29, 2008, in forum: Python
    Replies:
    0
    Views:
    325
    Neal Becker
    Aug 29, 2008
Loading...

Share This Page