in reply to A basic 'worker' threading example.
Nice post. I never used q->end() before, but enqueued an undef for each thread I had spawned. From now on I will go with the end method.
Normally I start the threads before I start putting work on the queue. In this case it won't make much difference unless the list of hosts to ping is very large, or the file read is the other side of a very slow network link. But sometimes the process sourcing the list of work is comparatively slow, so letting the threads get to work sooner can help
Cheers,
R.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: A basic 'worker' threading example.
by Preceptor (Deacon) on Dec 29, 2013 at 17:08 UTC |