Are we requesting too much transactional memory?

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?

+3
3

, , , , . , , , , , . , .

, STM , , . , , .

. STM, , .

I/O , , . , - . -, , , .

STM . , , . , , , , , , , . , , . , .

+1

.

, STM, , :

paper - . , , ( ​​/) - - .

+1

, , , . , , , ( ).

So, you can limit the effect of TM on only those parts of the code that contain locks, right? Each piece of code that may be called during a held lock must support TM in this scenario. How many of your programs do not store locks and are never called by code that contains locks?

0
source

Source: https://habr.com/ru/post/1708855/


All Articles