Threads

Alex Martelli aleaxit at yahoo.com
Mon Aug 13 17:16:25 EDT 2001


"Lad" <printers at sendme.cz> wrote in message
news:e34de21e.0108131242.55a471be at posting.google.com...
> Hi,
> I am a newbie with Python.I want to use threads in my application.
> Can you please let me know what is the best way of programming threads
> under Win32 systems?
> What modules shall I use?
> Is it better to use the thread module or the threading module or the
> stackless Python? What are differences?

Module threading is reasonably high-level and simple to use.  Module
thread is rather low-level and hard to use.  Stackless is great for
"user-level micro-threads" but they do NOT use the Win32's own
(native) threads, which I think is what you want.

The most important module for threading with only a FEW headaches,
right after threading, is Queue.  It does away with 74.6% of the worst
headaches with thread synchronization primitives if you architect
stuff around Queue's.

> Can you please give any example?

http://www.faqts.com/knowledge_base/view.phtml/aid/2796
http://www.bagley.org/~doug/shootout/bench/prodcons/alt/prodcons.python2.pyt
hon
many links from:
http://www.faqts.com/knowledge_base/index.phtml/fid/263
the whole of: http://www.python9.com/p9-aahz.pdf

Hope that's enough for starters...


Alex






More information about the Python-list mailing list