Multi-threaded applications typically use coarse- or fine-grain locks to enforce synchronization when needed. While fine-grain synchronization enables higher concurrency, it often involves significantly more programming effort than coarse-grain synchronization. To address this trade-off, this paper proposes Speculative Locks. Speculative Locks are based on the concepts and mechanisms of speculative thread-level parallelisation. Threads access a critical section without synchronizing, while the underlying hardware monitors for conflicting accesses. If a conflict is detected, threads are rolled back and restarted on the fly. Overall, Speculative Locks allow the programmability of coarse-grain synchronization while enabling the concurrency of fine-grain synchronization. The presence of a lock owner at all times guarantees forward progress, and all in-order conflicts between owner and speculative thread are tolerated. Under the right conditions, the resulting system performs about as well or better than a conventional one with finer-grain synchronization. In addition, it never performs worse than a conventional system with the same synchronization granularity.
Recommendations
Inferring locks for atomic sections
PLDI '08: Proceedings of the 29th ACM SIGPLAN Conference on Programming Language Design and ImplementationAtomic sections are a recent and popular idiom to support the development of concurrent programs. Updates performed within an atomic section should not be visible to other threads until the atomic section has been executed entirely. Traditionally, ...
Reducing Rollbacks of Transactional Memory Using Ordered Shared Locks
Euro-Par '09: Proceedings of the 15th International Euro-Par Conference on Parallel ProcessingTransactional Memory (TM) is a concurrency control mechanism that aims to simplify concurrent programming with reasonable scalability. Programmers can simply specify the code regions that access the shared data, and then a TM system executes them as ...
Inferring locks for atomic sections
PLDI '08Atomic sections are a recent and popular idiom to support the development of concurrent programs. Updates performed within an atomic section should not be visible to other threads until the atomic section has been executed entirely. Traditionally, ...