Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Parallel:ForkManager not creating specified threads

Status
Not open for further replies.

erdman

MIS
Apr 1, 2005
9
US
I am using the Parallel:ForkManager to multi-thread some of the processes I need to run very quickly on many machines. Unfortunately, after specifying the max number of threads the script is not coming even close to the max. Is there something i can add to the script to force it to create more threads for the process?

Thanks,
ERDMAN
 
Have you any logging to see what the issue might be, it could just be resources, or the threads are becoming deadlocked and crashing

At the start of each fork, have it write to a database or append to a log file it's number and PID.

--Paul

cigless ...
 
When you call new() to kick off ForkManager you specify the maximum number of threads you want ForkManager to limit itself to, like this.

my $pm = new Parallel::ForkManager(30);

That statement limits ForkManager to 30 threads, it's designed to get to the 31st thread and then wait until one of the already started threads has finished.

Mike

You cannot really appreciate Dilbert unless you've read it in the
original Klingon.

Want great answers to your Tek-Tips questions? Have a look at faq219-2884

 
I have the specified number of threads during the initial declaration as you have described. My issue is that it never "starts" any number of process near the max. I am underutilizing the machine resources when I need to nearly max out the dedicated box for my scans. Is there any way to specify a minimum number of child processes that are running at one time?
 
erdman,

Apologies for not getting back to you sooner.

Are you encountering an operating system limit on the number of processes (or threads?) that user is allowed to create?

What operating system and version of Perl are you using?

Mike

You cannot really appreciate Dilbert unless you've read it in the
original Klingon.

Want great answers to your Tek-Tips questions? Have a look at faq219-2884

 
I was able to kick up the desired number of threads after reinstalling ActivePerl 5.8.6. not sure what the initial issue was but the code i was using seems to be the correct syntax. Thanks for everyones help. :)

ERDMAN
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top