Idle wait for outstanding threads?

Michael Kelly mkelly2002NOSPAM at earthlink.net
Wed Jan 30 17:35:15 CET 2002


On 30 Jan 2002 05:18:47 -0800, alanmk at hotmail.com (Alan Kennedy)
wrote:

>Does anyone have any suggestions on how to do it? Or how to solve the
>problem in a different way using python libraries?

There is a module called Futures that simplifies manipulating
subtasks using threads.  It might not be what you need in this
case but should be a good candidate for your library even so.
It uses the metaphor of waiting for a function result.  You
launch your thread then call a method that returns the result.
You can block or not block but the basic idea is that if the
main thread has no other tasks you block on the function
result to wait for thread completion.

If appropriate for your program I guess you would launch
all your tasks and then finish up main thread business,
then block on all the thread method results etc..

I forget what site I downloaded from but a web search
turns it up no problem.


--

"If it's on Television chances are
 pretty good it's a TV Show."



More information about the Python-list mailing list