Safe Non-blocking Synchronization in Ada2x
The mutual-exclusion property of locks stands in the way to scalability of parallel programs on many-core architectures. Locks do not allow progress guarantees, because a task may fail inside a critical section and keep holding a lock that blocks other tasks from accessing shared data. With non-blocking synchronization, the drawbacks of locks are avoided by synchronizing access to shared data by atomic read-modify-write operations.
To incorporate non-blocking synchronization in Ada 202x, programmers must be able to reason about the behavior and performance of tasks in the absence of protected objects and rendezvous. We therefore extend Ada’s memory model by synchronized types, which support the expression of memory ordering operations at a sufficient level of detail. To mitigate the complexity associated with non-blocking synchronization, we propose concurrent objects as a novel high-level language construct. Entities of a concurrent object execute in parallel, due to a fine-grained, optimistic synchronization mechanism. Synchronization is framed by the semantics of concurrent entry execution. The programmer is only required to label shared data accesses in the code of concurrent entries. Labels constitute memory-ordering operations expressed through aspects and attributes. To the best of our knowledge, this is the first approach to provide a non-blocking synchronization construct as a first-class citizen of a high-level programming language. We illustrate the use of concurrent objects by several examples.
This research was supported by the Austrian Science Fund (FWF) project I 1035N23, and by the Next-Generation Information Computing Development Program through the National Research Foundation of Korea (NRF), funded by the Ministry of Science, ICT & Future Planning under grant NRF2015M3C4A7065522.
- 3.Adve, S.V., Hill, M.D.: Weak ordering–a new definition. In: Proceedings of the 17th Annual International Symposium on Computer Architecture, ISCA 1990, pp. 2–14. ACM, New York (1990)Google Scholar
- 5.Blieberger, J., Burgstaller, B.: Safe non-blocking synchronization in Ada 202x. CoRR, abs/1803.10067 (2018)Google Scholar
- 7.Boehm, H.-J., Adve, S.V.: Foundations of the C++ concurrency memory model. In: Proceedings of the 29th ACM SIGPLAN Conference on Programming Language Design and Implementation, PLDI 2008, pp. 68–78. ACM, New York (2008)Google Scholar
- 8.Brukardt, R.L. (ed.) Annotated Ada Reference Manual, ISO/IEC 8652:2012/Cor 1:2016 (2016)Google Scholar
- 11.Herlihy, M., Shavit, N.: The Art of Multiprocessor Programming. Morgan Kaufmann Publishers Inc., San Francisco (2012)Google Scholar
- 13.ISO/IEC: Working Draft N4296, Standard for Programming Language C++. ISO, Geneva, Switzerland (2014)Google Scholar
- 15.Manson, J., Pugh, W., Adve, S.V.: The Java memory model. In: Proceedings of the 32nd ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, POPL 2005, pp. 378–391. ACM, New York (2005)Google Scholar
- 16.Scott, M.L.: Shared-Memory Synchronization. Synthesis Lectures on Computer Architecture. Morgan & Claypool Publishers, San Francisco (2013)Google Scholar
- 18.Sorin, D.J., Hill, M.D., Wood, D.A.: A Primer on Memory Consistency and Cache Coherence. Synthesis Lectures on Computer Architecture, vol. 16. Morgan & Claypool, San Francisco (2011)Google Scholar
- 20.Williams, A.: C++ Concurrency in Action. Manning Publ. Co., Shelter Island (2012)Google Scholar
- 21.Xiong, W., Park, S., Zhang, J., Zhou, Y., Ma, Z.: Ad hoc synchronization considered harmful. In: Proceedings of the 9th USENIX Conference on Operating Systems Design and Implementation, OSDI 2010, Berkeley, CA, USA, pp. 163–176. USENIX Association (2010)Google Scholar
- 22.Zwinkau, A.: A memory model for X10. In: Proceedings of the 6th ACM SIGPLAN Workshop on X10, X10 2016, pp. 7–12. ACM, New York (2016)Google Scholar