tlds
Transactional Operations for Linked Data Structures
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
anonymous_namespace{swiss.cpp} Namespace Reference

Classes

struct  Swiss
 

Detailed Description

This is a good-faith implementation of SwissTM.

What that means, precisely, has to do with how we translate the SwissTM algorithm to allow /algorithmic/ comparisons with OrecEager and LLT. Specifically, we decided in the past that OrecEager and LLT would not use any of the clever 'lock is a pointer into my writeset' tricks that were proposed in the TinySTM paper, and so we don't use those tricks here, either. The cost is minimal (actually, with the RSTM WriteSet hash, the tricks are typically not profitable anyway), but it is worth stating, up front, that we do not adhere to this design point.

Additionally, orec management differs slightly here from in OrecEager and LLT. In those systems, we use "2-word" orecs, where the acquirer writes the old orec value in the second word after acquiring the first word. This halves the cost of logging, as the list of held locks only gives orec addresses, not the old values. However, in SwissTM, there is a tradeoff where on one hand, having rlocks separate from wlocks can decrease cache misses for read-only transactions, but on the other hand doing so doubles logging overhead for read locking by writers at commit time. It would be odd to use the 2-word orecs for read locks and not for write locks, but a more efficient technique is to use the second word of 2-word orecs as the rlock, and then use traditional 2-word lock logging, where the old lock value is also stored.

Other changes are typically small. The biggest deals with adding detection of remote aborts, which wasn't discussed in the paper.

NB: we could factor some CM code out of the RO codepath. We could also make the phase2 switch cause a thread to use different function pointers.