Research Article
Automated dynamic detection of busy–wait synchronizations
Article first published online: 23 MAR 2009
DOI: 10.1002/spe.922
Copyright © 2009 John Wiley & Sons, Ltd.
Additional Information
How to Cite
Tian, C., Nagarajan, V., Gupta, R. and Tallam, S. (2009), Automated dynamic detection of busy–wait synchronizations. Software: Practice and Experience, 39: 947–972. doi: 10.1002/spe.922
Publication History
- Issue published online: 1 JUL 2009
- Article first published online: 23 MAR 2009
- Manuscript Accepted: 12 FEB 2009
- Manuscript Revised: 6 FEB 2009
- Manuscript Received: 8 DEC 2008
Funded by
- NSF. Grant Numbers: CNS-0810906, CNS0751961, CCF-0753470, CNS-0751949
- Abstract
- References
- Cited By
Keywords:
- data race;
- synchronization;
- record/replay system;
- transactional memory;
- livelocks
Abstract
With the advent of multicores, multithreaded programming has acquired increased importance. In order to obtain good performance, the synchronization constructs in multithreaded programs need to be carefully implemented. These implementations can be broadly classified into two categories: busy–wait and schedule-based. For shared memory architectures, busy–wait synchronizations are preferred over schedule-based synchronizations because they can achieve lower wakeup latency, especially when the expected wait time is much shorter than the scheduling time. While busy–wait synchronizations can improve the performance of multithreaded programs running on multicore machines, they create a challenge in program debugging, especially in detecting and identifying the causes of data races. Although significant research has been done on data race detection, prior works rely on one important assumption—the debuggers are aware of all the synchronization operations performed during a program run. This assumption is a significant limitation as multithreaded programs, including the popular SPLASH-2 benchmark have busy–wait synchronizations such as barriers and flag synchronizations implemented in the user code. We show that the lack of knowledge of these synchronization operations leads to unnecessary reporting of numerous races. To tackle this problem, we propose a dynamic technique for identifying user-defined synchronizations that are performed during a program run. Both software and hardware implementations are presented. Furthermore, our technique can be easily exploited by a record/replay system to significantly speedup the replay. It can also be leveraged by a transactional memory system to effectively resolve a livelock situation. Our evaluation confirms that our synchronization detector is highly accurate with no false negatives and very few false positives. We further observe that the knowledge of synchronization operations results in 23% reduction in replay time. Finally, we show that using synchronization knowledge livelocks can be efficiently avoided during runtime monitoring of programs. Copyright © 2009 John Wiley & Sons, Ltd.

1097-024X/asset/olbannerleft.jpg?v=1&s=2d7d001211f2c40f177a231141601e9f52afc1f3)
1097-024X/asset/olbannerright.jpg?v=1&s=3aec7891a8ba78b361ead9743adfc0b6eae6369a)
1097-024X/asset/cover.gif?v=1&s=5a70ecca2928358eca4ff75b9921d0552ffb6539)