Multithreading and locking

Aahz aahz at
Thu Sep 18 18:29:16 CEST 2003

In article <bkbv5l$kgl$1 at>, Ivan Voras <ivoras at> wrote:
>Is it true what I heard (as a "rumour" of sorts), that in multithreaded
>Python programs global variables are already automagically protected by
>mutexes? Can someone clarify on that?

In addition to Duncan's excellent answer, I'd suggest that if you're
using phrases like "global variables", you probably want to learn more
about how Python's object model works in addition to learning more about
writing good threaded programs.  You want to avoid sharing mutable names
across threads as much as possible.
Aahz (aahz at           <*>

"It is easier to optimize correct code than to correct optimized code."
--Bill Harlan

More information about the Python-list mailing list