SMP, GIL and Threads

Donn Cave donn at u.washington.edu
Fri Dec 16 13:59:42 EST 2005


In article <mailman.2222.1134754305.18701.python-list at python.org>,
 Steve Holden <steve at holdenweb.com> wrote:
...
> I don't see why you should get problems on SMP hardware, since the 
> threads are all part of the same process and should therefore (I'd have 
> thought) be tagged with the same processor affinity. Hence the GIL 
> should manage contention successfully.

Could you explain your thinking there?  I don't know that much
about SMP.  Would have thought that affinity might make a difference
with on-processor cache and so forth, but would be transparent to
applications.  Are you thinking that the processor affinity would
essentially serialize execution, so SMP hardware doesn't matter
because your threads won't execute concurrently anyway?

> Threads most often use Queue.Queue to communicate, precisely because its 
> operations are guaranteed thread-safe.

(Just thought that might bear repetition.)

   Donn Cave, donn at u.washington.edu



More information about the Python-list mailing list