Threading a for loop in Perl?
1 post • Page 1 of 1
Is it possible to use multiple threads when parsing a for, foreach, etc... loop in Perl? I believe ActivePerl is not multi-threaded, but I have been able to implement threading using some external modules with success. I would like to figure out how to multi-thread a loop to make it execute faster.
Basically what I am doing is...
foreach $stuff (@array_of_stuff){
exececute_subroutine($stuff);
}
The issue is that the exececute_subroutine() subroutine can take several seconds to complete which makes the overall script execution take a long time.
Basically what I am doing is...
foreach $stuff (@array_of_stuff){
exececute_subroutine($stuff);
}
The issue is that the exececute_subroutine() subroutine can take several seconds to complete which makes the overall script execution take a long time.
Check out http://applicationbistro.com
Learn to create applications or guide others in the right direction.
Learn to create applications or guide others in the right direction.
- bcarroll
- Posts: 247
- Joined: Fri May 09, 2003 7:37 am
- Location: At the keyboard, probably writing a Perl script
1 post • Page 1 of 1
Return to Programming and Scripting
Who is online
Users browsing this forum: No registered users and 1 guest
