[Python-Dev] STM and python

Charles-François Natali neologix at free.fr
Wed Nov 30 17:45:07 CET 2011

> However given advances in locking and garbage collection in the last
> decade, what attempts have been made recently to try these new ideas
> out? In particular, how unlikely is it that all the thread safe
> primitives, global contexts, and reference counting functions be made
> __transaction_atomic, and magical parallelism performance boosts
> ensue?

I'd say that given that the current libitm implementation uses a
single global lock, you're more likely to see a performance loss.
TM is useful to synchronize non-trivial operations: an increment or
decrement of a reference count is highly trivial (and expensive when
performed atomically, as noted), and TM's never going to help if you
put each refcount operation in its own transaction: see Armin's
for more realistic use cases.

More information about the Python-Dev mailing list