Skip to content

A header only thread synchronization library using Intel RTM (Restricted Transactional Memory)

License

Notifications You must be signed in to change notification settings

BazookaMusic/TSXGuard

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 

Repository files navigation

TSXGuard

A header only thread synchronization library using Intel RTM (Restricted Transactional Memory)

Example Use

// a global lock
SpinLock lock;

// initialize a variable to capture
// user aborts
unsigned char status = 0;

// number of retries before using
// global lock as a fallback mechanism
// (TSX is a best effort implementation
//  and a fallback is required
//  to guarantee progress)
const int n_retries = 20;
{
  TSX::TSXGuard guard(n_retries,lock,status);

  // everything in scope will execute
  // atomically using Intel TSX

}

Releases

No releases published

Packages

No packages published

Languages