Sergeyk has asked for the wisdom of the Perl Monks concerning the following question:

Hi! I'm looking for a module for Perl with multiprocess support. Now I'm using parallel::forkmanager but this module does not communicate with the childs after forking, i.e. can not give more data then was passed at moment of forking. And I can not send complex data structures to childs Module must have following properties: 1) the ability to run the desired number of processes 2) keep them alive as much as i need 3) ability to transmit data to the parent process when new data arrive, i.e. childs periodically check the availability of data in the buffer and read out the data 4) ability to transmit data to childs as objects and obtain the result from childs in the form of objects ie I create offspring, provide them with the data from time to time, then obtain the result of the work without interruption of their existence and then all work done destroy them

Replies are listed 'Best First'.
Re: Multiprocess module
by BrowserUk (Patriarch) on May 12, 2012 at 15:42 UTC

    threads can fulfill all of those requirements except being multiprocess.

    Multi-threaded; multi-tasking; but not multiprocess. The question you've to ask yourself, is why must it be multiprocess?


    With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.

    The start of some sanity?

Re: Multiprocess module
by tobyink (Canon) on May 12, 2012 at 18:57 UTC

    In addition to what BrowserUK said, if you really do need separate processes, they can communicate using TCP sockets, named pipes, etc.

    perl -E'sub Monkey::do{say$_,for@_,do{($monkey=[caller(0)]->[3])=~s{::}{ }and$monkey}}"Monkey say"->Monkey::do'