in reply to Re^3: How to do parallel processing within mod_perl
in thread How to do parallel processing within mod_perl

If you don't tell us what isn't working about the code, we probably can't guess how to fix it.

I think you may get better help by asking on the mod_perl list, but if you do, make sure to explain how the code is failing.

  • Comment on Re^4: How to do parallel processing within mod_perl

Replies are listed 'Best First'.
Re^5: How to do parallel processing within mod_perl
by Anonymous Monk on Nov 14, 2007 at 14:43 UTC

    Well, as I said in my last reply: "@result is empty".

    I did some more searching and reading and it seems there are two reasons: First, I have to use waitpid somehow (don't know how to do this with multiple/unknown number of sub-processes and Second it doesn't seem to be easy to share a variable between parent and kids. I need this because the whole point is to collect search results from the children and I don't know how to get them back to the parent.

    I will write to the mod_perl list as you suggested and thanks for getting me that far.

    -Michael

      it doesn't seem to be easy to share a variable between parent and kids. I need this because the whole point is to collect search results from the children and I don't know how to get them back to the parent
      Sounds like you want threads.

      -David

        Threads are generally not advisable in situations like mod_perl or FastCGI with Perl, because they take up a lot more memory than a prefork approach. They can be useful for short-lived things, but usually forking is less resource-intensive due to the non-shared nature of Perl threads and copy-on-write savings for forking.