PyPy STM work update
morepypy.blogspot.com
morepypy.blogspot.com
Pessimistic STMs are built on locks. They make code involving fine-grained locking composable. So you can have many more locks instead of a global one, and recover gracefully from read/write conflicts and deadlocks. When latency is high, e.g. in distributed systems, optimistic strategies are more efficient. When latency is low, e.g. in SMP memory, pessimistic strategies more efficient. So pessimistic lock-based STMs are generally more efficient.
This implies that STM is not really a faster alternative to locking. It's a simply form of fine-grained locking that composes well. I believe STM will not eliminate the slowdown that results from fine-grained locking in freely-threaded Python interpreters, but it might just make them easier to write, which isn't a bad thing.
Oy. Armin is hopeful that STM will become for concurrency what garbage collection is for memory management. I'm really hopeful he's right. While I know there's still lots of work to be done, that kind of speed hit is, however, discouraging :(
Not to mention that Hardware Transactional Memory is coming the next generation of intel chips (Q2 2013) and like virtualization it might just be that hardware support is required to give it the boost required.
Either way, I think the research is important because its based around a real language, with real production code. All too often CS research is based around idealized languages and thus all the code tends to be coded to the capabilities of the language, instead of the code that is often suboptimal, because the developer was under the gun to meet a deadline.
There's no reason to suffer 16 cores performing like three (assuming no contention), when you can get much closer to linear with existing, mature, and well-understood technologies.
That seems incredibly shortsighted.