.NET Framework 4.0 received Software Transactional Memory engine

    Software Transactional Memory (STM) is an alternative to locks and other traditional mechanisms for synchronizing asynchronous operations and threads when accessing a shared memory location. The STM mechanism is similar to the operation of transactions in modern DBMSs, and although its use is generally slower than the use of locks, STM offers the developer a simpler way to manage parallel computing.

    Using STM in .NET is extremely simple:

    Atomic.Do (() => {

    });

    where statements is the expression to be executed in the transaction.

    There are many libraries implementing STM for many languages. STM for .NET previously existed as a separate project of the Microsoft Research group, in addition to C # there are 4 more STM libraries. And now, this mechanism has become part of the framework.

    * download .NET 4.0 from STM msdn.microsoft.com/en-us/devlabs/ee334183.aspx
    * wiki article about STM en.wikipedia.org/wiki/Software_transactional_memory (eng)
    * article Beautiful Сoncurency (Haskell) research.microsoft .com / en-us / um / people / simonpj / papers / stm / beautiful.pdf (pdf), thanks shai_xylyd

    viawww.infoq.com/news/2009/07/Software-Transactional-Memory

    Also popular now: