skip to main content
article

Comparing Java, C# and Ada monitors queuing policies: a case study and its Ada refinement

Published:01 August 2006Publication History
Skip Abstract Section

Abstract

Learning concurrency paradigms is necessary but it is not sufficient since the choice of run-time semantics may introduce subtle programming errors. It is the aim of this paper to exemplify the importance of process queuing and awaking policies resulting from possible choices of the monitor concept implementation.The first part of the paper compares the behaviour of concurrent processes sharing a unique waiting queue for condition synchronization when implemented in Java or in Ada. A particular solution of the dining philosophers paradigm will be used to show how the difference in the monitor semantics may lead or not to deadlock. This comparison provides insight for deriving a correct Java implementation. The second part of the paper shows how the implementation can be refined when using Ada entry families and requeue with requeue once restriction. The result is elegant, safe and fair, and deterministic. This paper ends with quantitative comparisons of concurrency complexity and of concurrency effectiveness.We conclude that Java and C# multithreading need defensive concurrent programming while Ada allows more latitude for developing correct concurrent programs.

References

  1. {ACCOV 2005} http://deptinfo.cnam.fr/Enseignement/CycleSpecialisation/ACCOV/Google ScholarGoogle Scholar
  2. {Ada 1999} Ada 95 Reference Manual, International Standard ANSI/ISO/IEC-8652: 1995, January 1999.Google ScholarGoogle Scholar
  3. {Barkaoui 1997} K. Barkaoui, C. Kaiser and J. F. Pradat-Peyre. Petri nets based proofs of Ada95 solution for preference control. Joint APSEC97/ICSC97 Conference. Hong-Kong December 1997, 15 pages. IEEE CS Press 1997. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. {Bétourné 1971} C. Bétourné, J. Ferrié, C. Kaiser, S. Krakowiak and J. Mossière. System Design Using Parallel Processes. IFIP congress 1971. pp. 345--352. North Holland. 1971.Google ScholarGoogle Scholar
  5. {Brosgol 1996} B. Brosgol. The dining philosophers in Ada95. In Reliable Software Technologies-Ada-Europe'96, LNCS 1088, pp. 247--261. Springer-Verlag, 1996. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. {Buhr 1995} P. Buhr, M. Fortier, M. Coffin. Monitor Classification, ACM Computing Survey, 27, 1, pp. 63--107. 1995. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. {Burns 1995} A. Burns and A. Wellings. Concurrency in Ada, Chapter 6.11, pp. 134--137. Cambridge University Press, 1995. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. {Burns 2004} A. Burns, B. Dobbing and T. Vardanega. Guide for the use of the Ada Ravenscar Profile in high integrity systems. ACM SIGAda Ada Letters, 24, 2. pp. 1--74, June 2004. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. {Dijkstra 1968} E. W. Dijkstra. The Structure of the "THE" Multiprogramming System. Communications of the ACM, 11, 5. pp. 341--346, May 1968. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. {Dijkstra 1971} E. W. Dijkstra. Hierarchical ordering of sequential processes. Acta Informatica, number 1, pp. 115--138, 1971. (also available as EWD310 at http://www.cs.utexas.edu/users/EWD/)Google ScholarGoogle Scholar
  11. {Evangelista 2003} S. Evangelista, C. Kaiser, J. F. Pradat-Peyre, P. Rousseau. Quasar: a new tool for analyzing concurrent programs. International Conference on Reliable Software Technologies, Ada-Europe'03, LNCS vol. 2655, pp. 166--181, Springer-Verlag 2003. Toulouse, France, June 2003.Google ScholarGoogle Scholar
  12. {Hoare 1974} C. Hoare. Monitors: An operating system structuring concept. Communications of the ACM. 17, 10. pp. 549--557. October 1974. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. {Intermetrics 1995} Intermetrics Inc. Ada 95 Rationale, The Core Language, 9 Tasking, 9.1 Protected Types, page 9--5, Cambridge, Mass., 1995.Google ScholarGoogle Scholar
  14. {Kaiser 1997} C. Kaiser and J. F. Pradat-Peyre. Comparing the reliability provided by tasks or protected objects for implementing a resource allocation service: a case study. Tri-Ada'97 Conference, Saint-Louis, USA. pp. 51--65. ACM publication, 1997. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. {Knuth 1969} D. Knuth. The Art of Computer Programming, Volume 1. Fundamental Algorithms. 634 pages. Addison-Wesley 1969. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. {Lea 1998} D. Lea. Patterns and the democratization of concurrent programming, IIE Concurrency, Parallel, Distributed & Mobile Computing, 6, 4, pp. 11--13, 1998. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. {Quassar 2006}. http://quasar.cnam.fr/Google ScholarGoogle Scholar

Index Terms

  1. Comparing Java, C# and Ada monitors queuing policies: a case study and its Ada refinement

          Recommendations

          Comments

          Login options

          Check if you have access through your login credentials or your institution to get full access on this article.

          Sign in

          Full Access

          • Published in

            cover image ACM SIGAda Ada Letters
            ACM SIGAda Ada Letters  Volume XXVI, Issue 2
            August 2006
            72 pages
            ISSN:1094-3641
            DOI:10.1145/1165678
            Issue’s Table of Contents

            Copyright © 2006 Authors

            Publisher

            Association for Computing Machinery

            New York, NY, United States

            Publication History

            • Published: 1 August 2006

            Check for updates

            Qualifiers

            • article

          PDF Format

          View or Download as a PDF file.

          PDF

          eReader

          View online with eReader.

          eReader