Basic threading questions

Jason Orendorff jason at jorendorff.com
Mon Dec 31 14:31:52 EST 2001


> 1. The library reference for the thread module says "Not all
> built-in functions that may block waiting for I/O allow other
> threads to run."  Is there a list of the built-in blocking
> operations that either block nicely, or do not block nicely?

No.  Most block nicely.  If you find one that doesn't, it's
(almost certainly) a bug.

> can I at least assume that the dictionary and list objects are
> thread-safe, and that adding, deleting, replacing, and accessing 
> attributes of a class are thread-safe?

Yes.

> If it matters, I'm using Python 2.2.0 under Win98 and Win2K, but 
> I'd prefer a more general discussion of the issues involved.

This page starts with a very technical discussion:
http://www.python.org/doc/current/api/threads.html

Other than the Global Interpreter Lock, Python threads behave
just like native Win32 threads, because that's what they are.

## Jason Orendorff    http://www.jorendorff.com/





More information about the Python-list mailing list