Embedded perl - how to find out real PID after fork

Discussion in 'Perl' started by Andrew Zhilenko, Nov 22, 2004.

  1. Hello,

    Apparently Perl caches the value of the $$ variable (PID). So if it is a
    process with the embedded perl, and fork was performed not from within the
    Perl code, but by the C code 'outside' - the value of the $$ variable
    stays the same. I can see this topic already have been discussed, but
    apparently ha not been fixed:
    http://groups.google.com/groups?hl=...34857.210a254b.rgarciasuarez%40free.fr&rnum=6

    Any suggestions? I can, of course, create an XS module which will call
    C-function "getpid" and this module will called from my embedded perl code
    - but this very inelegant way of solving the problem.

    WBR, Andrew
    --
    Andrew Zhilenko
    Please remove "hide-email." from my email address when replying,
    so my address should be andrew (at) ti dot cz
     
    Andrew Zhilenko, Nov 22, 2004
    #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. senthil
    Replies:
    5
    Views:
    1,391
    senthil
    Jan 24, 2004
  2. Replies:
    0
    Views:
    649
  3. Muhammad Nasir Waqar

    How to find out the OS is Real or VPS?

    Muhammad Nasir Waqar, Feb 14, 2007, in forum: ASP .Net
    Replies:
    0
    Views:
    309
    Muhammad Nasir Waqar
    Feb 14, 2007
  4. Eric Snow

    os.fork and pty.fork

    Eric Snow, Jan 8, 2009, in forum: Python
    Replies:
    0
    Views:
    575
    Eric Snow
    Jan 8, 2009
  5. Stuart Clarke

    Slow Find.find - real problem

    Stuart Clarke, Sep 4, 2010, in forum: Ruby
    Replies:
    7
    Views:
    145
    Stuart Clarke
    Sep 6, 2010
Loading...

Share This Page