AnyEvent::Fork clarification

Vikas N Kumar vikas at vikaskumar.org
Thu Jan 9 06:00:50 CET 2014


Hi Marc,

In continuation of the AnyEvent::Fork questions, here is what I am now
facing:

Scenario:
- a GUI built using Prima. on a button click uses AnyEvent::Fork to fork
a bunch of non-perl processes and detects how many are complete and
shows some info on a window
- the forking portion is written in a module called MyForker.pm for example
- there is a unit test written specifically to test MyForker.pm and it
works perfectly
- forced use of POE::Loop::Prima is done to make sure there is no
problems. AnyEvent::detect says using AnyEvent::Impl::POE.
- the unit test works perfectly with EV instead of POE as well
- the unit test uses AnyEvent->condvar to wait and the GUI doesn't use
it as Prima has its own event loop and that is doing the wait

Problems:
- the GUI is responsive but the AnyEvent forks don't happen. On running
"ps x" you can see AnyEvent::Fork/exec of $PID and AnyEvent::Fork of
$PID but the actual non-perl processes that were supposed to be forked
were not seen. The unit-test on the other hand does this just fine

- the GUI is able to fork if AnyEvent->condvar->recv is called on the
button click but this causes the processes to complete but hang around
as zombies unless the whole GUI process exits.

How do I go about fixing these problems or finding ways to debug what is
happening ?

Thanks
Vikas



More information about the anyevent mailing list