Working threads progress

ryles rylesny at gmail.com
Wed Oct 28 23:04:45 EDT 2009


On Oct 28, 7:02 pm, mattia <ger... at gmail.com> wrote:
> Now, I would like to know the activity done (e.g. every two seconds) so I
> create another thread that checks the queue size (using .qsize()). Have
> you any suggestion to improve the code?

It's not uncommon to pass each thread a second queue for output, which
in your case might be tuples of (item, result). You can read from this
queue in a single thread, and since the results now accumulate
incrementally, you can easily collect more detailed status/progress
information (if that's what you're looking for).



More information about the Python-list mailing list