Embedded perl - how to find out real PID after fork

A

Andrew Zhilenko

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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,773
Messages
2,569,594
Members
45,122
Latest member
VinayKumarNevatia_
Top