in reply to Re^2: 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;

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»

  • Comment on Re^3: Please Explain the Parallel::ForkManager Idiom my $pid = $pm->start and next;

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

    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»

        "Yet another" mental block? Yes, indeed. ☹

        As evidence of my earnestness and seriousness, here's a demo Perl script my friend wrote and shared with me last weekend. I refactored it into subroutines as an exercise to help me understand how forking works, which I sort of thought I did until I started toying with Parallel::ForkManager afterwards. Please rip the script to shreds if you think it will help me learn.

        Thank you for the references to the helpful resources.

        Jim