Advertisement

Safe Non-blocking Synchronization in Ada2x

Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 10873)

Abstract

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.

Notes

Acknowledgments

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.

References

  1. 1.
    Adve, S.V., Boehm, H.-J.: Memory models: a case for rethinking parallel languages and hardware. Commun. ACM 53(8), 90–101 (2010)CrossRefGoogle Scholar
  2. 2.
    Adve, S.V., Gharachorloo, K.: Shared memory consistency models: a tutorial. Computer 29(12), 66–76 (1996)CrossRefGoogle Scholar
  3. 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
  4. 4.
    Barnes, J.: Ada 2012 Rationale: The Language – The Standard Libraries. LNCS, vol. 8338. Springer, Heidelberg (2013).  https://doi.org/10.1007/978-3-642-45210-9CrossRefGoogle Scholar
  5. 5.
    Blieberger, J., Burgstaller, B.: Safe non-blocking synchronization in Ada 202x. CoRR, abs/1803.10067 (2018)Google Scholar
  6. 6.
    Boehm, H.-J.: Threads cannot be implemented as a library. SIGPLAN Not. 40(6), 261–268 (2005)CrossRefGoogle Scholar
  7. 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. 8.
    Brukardt, R.L. (ed.) Annotated Ada Reference Manual, ISO/IEC 8652:2012/Cor 1:2016 (2016)Google Scholar
  9. 9.
    Gharachorloo, K., Lenoski, D., Laudon, J., Gibbons, P., Gupta, A., Hennessy, J.: Memory consistency and event ordering in scalable shared-memory multiprocessors. SIGARCH Comput. Archit. News 18(2SI), 15–26 (1990)CrossRefGoogle Scholar
  10. 10.
    Barnes, J. (ed.): Ada 95 Rationale: The Language – The Standard Libraries. LNCS, vol. 1247. Springer, Heidelberg (1995).  https://doi.org/10.1007/BFb0051526CrossRefGoogle Scholar
  11. 11.
    Herlihy, M., Shavit, N.: The Art of Multiprocessor Programming. Morgan Kaufmann Publishers Inc., San Francisco (2012)Google Scholar
  12. 12.
    Hoare, C.A.R.: Monitors: an operating system structuring concept. Commun. ACM 17(10), 549–557 (1974)CrossRefGoogle Scholar
  13. 13.
    ISO/IEC: Working Draft N4296, Standard for Programming Language C++. ISO, Geneva, Switzerland (2014)Google Scholar
  14. 14.
    Lamport, L.: How to make a multiprocessor computer that correctly executes multiprocess programs. IEEE Trans. Comput. 28(9), 690–691 (1979)CrossRefGoogle Scholar
  15. 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. 16.
    Scott, M.L.: Shared-Memory Synchronization. Synthesis Lectures on Computer Architecture. Morgan & Claypool Publishers, San Francisco (2013)Google Scholar
  17. 17.
    Simpson, H.: Four-slot fully asynchronous communication mechanism. IEE Proc. E Comput. Digit. Tech. 137, 17–30 (1990)CrossRefGoogle Scholar
  18. 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
  19. 19.
    Ševčík, J., Aspinall, D.: On validity of program transformations in the Java memory model. In: Vitek, J. (ed.) ECOOP 2008. LNCS, vol. 5142, pp. 27–51. Springer, Heidelberg (2008).  https://doi.org/10.1007/978-3-540-70592-5_3CrossRefGoogle Scholar
  20. 20.
    Williams, A.: C++ Concurrency in Action. Manning Publ. Co., Shelter Island (2012)Google Scholar
  21. 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. 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

Copyright information

© Springer International Publishing AG, part of Springer Nature 2018

Authors and Affiliations

  1. 1.Institute of Computer Engineering, Automation Systems GroupTU WienViennaAustria
  2. 2.Department of Computer ScienceYonsei UniversitySeoulKorea

Personalised recommendations