How the below blocks will get executed ? This is my my first thread program, want to understand in details.
My requirement : i will have 1000's of data server which will be diveided in different groups. Now if I start this program, will all 1000's of dataserver be processed by 10 or 20 threads.
Also this has to be keep running based on some interval time. Once we put all serverrs in enqueue, how each thread will pick up the data.
note: each dataserver will be on different host and port so connection will be independent.
Thanks for help.
# Tell each thread that we're done
for (1..$THREADS) { #####what is this block doing
$request->enqueue(undef);
};
# Launch our threads
for (1..$THREADS) {
async(\&getData);
};