I have been reading a lot about transactional memory lately. There is a bit of hype around TM, so many people are enthusiastic about this, and it offers solutions for painful problems with blocking, but you also regularly see complaints:
- You cannot do I / O
- You need to write your atomic partitions so that they can run several times (be careful with your local variables!)
- Transactional software memory provides poor performance
- [Insert your pet on a visit]
I understand these problems: most often you will find articles about STM that work only on certain equipment that supports some really excellent atomic operation (for example, LL / SC ), or it must be supported by some kind of imaginary compiler or require all calls to memory were transactional, he introduced monad-style font types, etc. And above all: these are real problems.
This made me ask myself: what speaks against the local use of transactional memory as a replacement for locks? . Would this already bring enough value, or would transactional memory be used everywhere, if at all?