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

  • Authors:
  • Claude Kaiser;Jean-François Pradat-Peyre;Sami Évangelista;Pierre Rousseau

  • Affiliations:
  • CEDRIC - CNAM Paris, rue St Martin, Paris;CEDRIC - CNAM Paris, rue St Martin, Paris;CEDRIC - CNAM Paris, rue St Martin, Paris;CEDRIC - CNAM Paris, rue St Martin, Paris

  • Venue:
  • ACM SIGAda Ada Letters
  • Year:
  • 2006

Quantified Score

Hi-index 0.00

Visualization

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.