threads

Hrvoje Niksic hniksic at srce.hr
Fri Jun 4 23:45:38 CEST 1999


Jeremy Hylton <jeremy at cnri.reston.va.us> writes:

> If I recall correctly, the problem is that taking away one big lock
> usually requires introducing lots of little locks.  (There's some
> kind of conservation of concurrency going on.)  Right now, there is
> no need to have locks on access to builtin types like dictionaries,
> because only a single thread can hold the interpreter lock anyway.
> When that goes away, you need to add lots of fine-grained locking on
> the builtin types.

You are right.

Ironically, when I first saw "tuples" in Python, I assumed they were
invented to speed up threading because you don't need to lock access
to immutable structures.  (The same applies to immutable strings.)
Boy, was I wrong.  :-(




More information about the Python-list mailing list