in reply to Re: Please Explain the Parallel::ForkManager Idiom my $pid = $pm->start and next;
in thread Please Explain the Parallel::ForkManager Idiom my $pid = $pm->start and next;

Thanks. I still don't get it. I'm having a more profound problem than just not understanding the idiom. I don't understand the ubiquitous expressions I read over and over again in the documentation and in PerlMonks tutorials and posts:  "…in the parent process…", "…in the child process…", etc. These make no sense to me. And running the example scripts and observing their behavior isn't helping, but instead making it worse because the behavior is utterly counterintuitive to me. The particular example code I'm running from the module's perldoc page has sleep()s in it that I know the code is reaching, but are never actually happening. There's never a pause in the execution of the program. It blows right past the sleep()s.

Replies are listed 'Best First'.
Re^3: Please Explain the Parallel::ForkManager Idiom my $pid = $pm->start and next;
by karlgoethebier (Abbot) on Feb 04, 2014 at 09:17 UTC

    Mh, imho the example with the callbacks is very nice and instructive. Did you run it and take a look at watched top during execution?

    Regards, Karl

    «The Crux of the Biscuit is the Apostrophe»

      Yep. That's the script I'm running and studying, and the one I mentioned is utterly confounding me.

      Jim

        I wonder why you are struggling so much with this issue - yet another mental block?

        Please take a look at Fork-exec. And perhaps try to build an application based on the template mentioned that does something "useful" and watch/study your process table using ps and/or top.

        And imho Network Programming with Perl by Lincoln_Stein has still a nice and gentle introduction to fork, exec, daemonizing a.s.o.

        Best regards, Karl

        «The Crux of the Biscuit is the Apostrophe»