Aviad Ezra

Aviad Ezra aviade aviade

Niner since 2009

I am a software developer and architect specializing in development of soft real time applications using .NET technologies. I have over 9 years of experience in architecture, design and development of successful applications.

Comments

  • Programming in the Age of Concurrency: Software ​Transaction​al Memory

    When STM detects a long transaction that conflict - it immediately switches to more pessimistic approach (which works a lot like reader/writer locks).  

     

    For such cases STM employ the use of a contention manager (CM) that detect conflicts and decides, according to a pre-defined policy, which read-mode technique to use. By default, when transaction starts, CM attempts to use the optimistic read technique, once it detects a conflict, it considers switching to a more pessimistic approach (using reader/writer locks) depending on the transaction size (defined by the reads count) and the re-execution count.

     

    As you mentioned, a naive optimistic read technique with automatic execution schema can lead to starvation in cases where a large transaction conflict with smaller transactions that execute periodically.