Threading help?

VanL Van at Lindbergs.org
Wed Mar 6 00:40:43 EST 2002


Hello,

This is my first time playing with python threads, and I am a little at 
a loss how to start.  Here is what I need to do:

I need three threads (at least):

1. Every .1 second, retrieves some data via http from an adjacent 
machine on the network.  Easy enough with urllib.
2. Do processing on that data
3. Every .1 second, be ready to spit out the most recent results from 
the processing in response to an http query.  I've got the latest medusa 
distribution, and I was thinking about using that.   It doesn't really 
matter, though.

As you can see, I have two things that have soft real-time deadlines, 
and one thing that I want to do as fast as possible, but doesn't need to 
be real time.  This sounds like a job for threads.

I can do each of the individual parts, but I don't know how to combine 
them all so that each is running in a different thread, so that process 
2 doesn't make the other two lose their timing.

Any help?

Thanks in advance,

Van





More information about the Python-list mailing list