[Tutor] Python 2.4 threading
Kent Johnson
kent37 at tds.net
Tue Oct 21 21:06:09 CEST 2008
On Tue, Oct 21, 2008 at 1:04 PM, Ertl, John C CIV 63134
<john.ertl at navy.mil> wrote:
> 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.
You don't need a class to use threading. This example uses ordinary functions:
http://blog.doughellmann.com/2007/04/pymotw-queue.html
However if your program is compute-bound threading won't help.
Kent
More information about the Tutor
mailing list