Towards fair, scalable, locking
Enrique Vallejo, Sutirtha Sanyal, Tim Harris, Fernando Vallejo, Ramon Beivide Palacio, Osman Ünsal, Adrián Cristal Kestelman, Mateo Valero Cortés · UPCommons institutional repository (Universitat Politècnica de Catalunya) · 2008
Without care, Hardware Transactional Memory presents several performance pathologies that can degrade its performance. Among them, writers of commonly read variables can suffer from starvation. Though different solutions have been proposed for HTM systems, hybrid systems can still suffer from this performance problem, given that software transactions don’t interact with the mechanisms used by hardware to avoid starvation. In this paper we introduce a new per-directory-line hardware contention management mechanism that allows fairer access between both software and hardware threads without the need to abort any transaction. Our mechanism is based on “reserving” directory lines, implementing a limited fair queue for the requests on that line. We adapt the mechanism to the LogTM conflict detection mechanism and show that the resulting proposal is deadlock free. Finally, we sketch how the idea could be applied more generally to reader-writer locks.