|
Prev: FAQ 9.18 How do I decode a MIME/BASE64 string?
Next: FAQ 9.21 How do I use MIME to make an attachment to a mail message?
From: howa on 16 Apr 2008 04:44 Sometimes, I want to take the advantage of multi-core processor, and make the full use of my CPU time, e.g. I have a function, which takes a file name as input, do some text processing (e.g. CPU intensive), and save it back. I don't want to use thread, as it need to recompile perl on all my machines and I am not sure if it is stable enough to affect other apps. I don't mind to have a little overhead in using the fork mode (i.e. multi-process). I want to know are there any recommended module for my purpose? For example, I am trying Parallel::ForkManager, POE::Wheel::Run, so anyone want to share the experiences? Thanks.
From: Peter Makholm on 16 Apr 2008 04:50 howa <howachen(a)gmail.com> writes: > For example, I am trying Parallel::ForkManager, POE::Wheel::Run, so > anyone want to share the experiences? I have used Parallel::ForkManager a lot with no problems, it just works. I have never had the need to communicate enything more complex than the exit code back to the parrent though. //Makholm
From: nolo contendere on 16 Apr 2008 11:03 On Apr 16, 4:50 am, Peter Makholm <pe...(a)makholm.net> wrote: > howa <howac...(a)gmail.com> writes: > > For example, I am trying Parallel::ForkManager, POE::Wheel::Run, so > > anyone want to share the experiences? > > I have used Parallel::ForkManager a lot with no problems, it just > works. I have never had the need to communicate enything more complex > than the exit code back to the parrent though. I've found it useful to pass an $ident which i can use in the run_on_finish callback to associate with the exit code.
From: Peter Makholm on 16 Apr 2008 11:10 nolo contendere <simon.chao(a)fmr.com> writes: >> I have used Parallel::ForkManager a lot with no problems, it just >> works. I have never had the need to communicate enything more complex >> than the exit code back to the parrent though. > > I've found it useful to pass an $ident which i can use in the > run_on_finish callback to associate with the exit code. Yes, but I consider this to be communication from the parrent on fork time to the parrent on wait time. Even if the $ident is an reference to something, the child can't change it for the parrent. //Makholm
From: nolo contendere on 16 Apr 2008 12:32
On Apr 16, 11:10 am, Peter Makholm <pe...(a)makholm.net> wrote: > nolo contendere <simon.c...(a)fmr.com> writes: > >> I have used Parallel::ForkManager a lot with no problems, it just > >> works. I have never had the need to communicate enything more complex > >> than the exit code back to the parrent though. > > > I've found it useful to pass an $ident which i can use in the > > run_on_finish callback to associate with the exit code. > > Yes, but I consider this to be communication from the parrent on fork > time to the parrent on wait time. Even if the $ident is an reference > to something, the child can't change it for the parrent. > True, perhaps I should have replied to the OP. I was simply sharing my experience with Parallel::ForkManager, didn't mean to imply that the $ident was a child->parent communication. |