develooper Front page | perl.ithreads | Postings from April 2010

Re: Help with concurrent threads

Thread Previous | Thread Next
From:
Paul Robert Marino
Date:
April 16, 2010 19:34
Subject:
Re: Help with concurrent threads
Message ID:
4bc91e24.8502be0a.3064.4c2e@mx.google.com
look at the threadlimit  and execute sub routines in any of the scripts in the mrtools project on sourceforge . I wrote these several years ago and they do exactly what you are asking about.

-----Original Message-----

From:  alfonso caponi <alfonso.caponi@gmail.com>
Subj:  Help with concurrent threads
Date:  Fri Apr 16, 2010 11:48 am
Size:  1K
To:  perl-ithreads@perl.org

Hi list,

Ive some doubts with a multi-threads script. My goal is to create a script with the same max number of threads running at all times.

For example: Ive an array with 9 elements and 3 threads to process it; each thread can process an element using a different time (a thread could end before another) and I would like 3 threads always running.

My idea is to take an element from a queue, start threads to reach the  maximum number of active threads allowed and simultaneously  start a separate (but unique) thread to wait every thread in execution.


Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About