MulticoreInfo.com header image 2

New interesting application of Transactional Memory for single-threading

October 28th, 2008 · No Comments




Author: Dmitriy V’jukov for Intel Software Network
While dealing with Transactional Memory I realize new interesting application of Transactional Memory for SINGLE threaded applications. Atomicity guarantees provided by TM can be useful not only for multi-threaded environment, but also for single-threaded environment. Well, it’s actually not astonishing, nevertheless I didn’t hear anything similar in all that hype around TM.

Assume we have complicated operation which involves non-trivial modifications of several objects/containers. Assume that exception can be thrown either by memory allocator, or by copy constructor of some object, or just by application logic. In order to provide strong exception safety in such situation we have to manually write code for cancellation of all those modifications. This can be non-trivial error-prone task.

TM already has all necessary machinery for cancellation of arbitrary operations. TM doesn’t care about complexity of operations, number of involved objects/containers, it can just instantly cancel anything which happens inside atomic block. Why don’t use it?

Full Story

  • Share/Save/Bookmark

Tags: Applications · MulticoreInfo · Programming

Like what you're reading? Come back every day for multicore news, or subscribe to RSS updates.



Stumble It!