in reply to problems with fork from thread
I don't know the answer to your question, but this article seems relevant: http://stackoverflow.com/questions/1235516/fork-in-multi-threaded-program.
If you just need some simple code to do 10 things at the same time, you might like Parallel::ForkManager. Example code looks something like this:
use Parallel::ForkManager; my $pm = new Parallel::ForkManager(10); foreach (1..10) { # Forks and returns the pid for the child: my $pid = $pm->start and next; &something_1(); $pm->finish; # Terminates the child process } $pm->wait_all_children;
-Matt
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: problems with fork from thread
by cristi1979 (Novice) on Mar 01, 2012 at 17:49 UTC | |
by BrowserUk (Patriarch) on Mar 02, 2012 at 07:06 UTC | |
by cristi1979 (Novice) on Mar 02, 2012 at 07:40 UTC | |
by Gangabass (Vicar) on Mar 04, 2012 at 02:49 UTC | |
by cristi1979 (Novice) on Mar 06, 2012 at 08:22 UTC | |
by Gangabass (Vicar) on Mar 02, 2012 at 06:42 UTC |