in reply to Re: open3 hangs
in thread open3 hangs

Hi

and thanks for your proposal. I have modified my code to use the old-fashioned pipe/fork/exec procedure showing me that open3 actually is not my problem. Instead fork blocks.

I did some more investigation and found that forking from a thread can be tricky because one may have to deal with locking issues (fork seems to clone all threads). Now I'm looking for a way to cleanly fork from a (Perl) thread and exec afterwards. Any ideas?

Kind regards,

Stephan

Replies are listed 'Best First'.
Re^3: open3 hangs
by salva (Canon) on Feb 20, 2009 at 10:18 UTC
    Instead of forking, try creating a new thread and launching the child via system... maybe your libc system() call will use a different aproach that doesn't need to lock other threads, for instance, a vfork based one.

      Hmmm… The documentation (perlfunc) says:

      Does exactly the same thing as "exec LIST", except that a fork is done first, and the parent process waits for the child process to complete.