[Tutor] Python 2.4 threading

Ertl, John C CIV 63134 john.ertl at navy.mil
Tue Oct 21 19:04:26 CEST 2008


Classification: UNCLASSIFIED 
Caveat (s): FOUO

All,

I have a program that basically loops through two loops and I wanted to speedup the stuff inside the second loop so I thought threading would be a good idea but I am having a hard time getting it to work.  All of the examples I have seen that use a Queu have had the threaded stuff inside its own class.  I have tired that but I am not getting it.

Could anyone give me some hints on how I might set this up.  Below is an outline of my current program.  What do I need to do to thread the inside loop.

Many of the functions depicted below inherit function from other modules.

class weather(a bunch of stuff)

     def 1

     def 2

     def3

     defetc


weax = weather()

.....stuff.....

for each in outsideloop:

        def1
        defn

        for each in insideloop:

                def1
                def2
                defn


I have tried to take the inside loop and make it a class but there are so many functions , some inherited that are used on the inside and outside loop that I am getting errors all over the place.  Is it possible to thread without it being its own class?  

Thanks for the ideas and help.


John Ertl
Meteorologist

FNMOC
7 Grace Hopper Ave.
Monterey, CA 93943
(831) 656-5704
john.ertl at navy.mil

Classification: UNCLASSIFIED 
Caveat (s): FOUO
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20081021/a9a6ec71/attachment.htm>


More information about the Tutor mailing list