Skip to main content

Weak Fairness Semantic Drawbacks in Java Multithreading

  • Conference paper

Part of the book series: Lecture Notes in Computer Science ((LNPSE,volume 5570))

Abstract

With the development of embedded and mobile systems, Java is being widely used for application programs and is also considered for implementing systems kernel or application platforms. It is the aim of this paper to exemplify some subtle programming errors that may result from the process queuing and awaking policy, which corresponds to a weak fairness semantic and which has been chosen for implementing the monitor concept in this language. Two examples show some subtle deadlocks resulting from this policy. The first example deals with process synchronization: processes seeking after partners for a peer-to-peer communication call a symmetrical rendezvous server. The second example concerns resource sharing according to a solution of the dining philosophers paradigm. In this example, several implementations are presented, the last ones aiming to provide deterministic process awakening. All these examples have been validated and simulated and this allows comparing their concurrency complexity and effectiveness. Our conclusion is, first, that the use of Java for multithreading programming necessitates sometimes additional shielding code for developing correct programs and, second, that a good acquaintance with several styles of concurrent programming helps designing more robust Java solutions, once the choice of the implementation language is irrevocable.

This is a preview of subscription content, log in via an institution.

Buying options

Chapter
USD   29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD   39.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD   54.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Learn about institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. Accov master class lecture notes, http://deptinfo.cnam.fr/Enseignement/CycleSpecialisation/ACCOV/

  2. Bétourné, C., Ferrié, J., Kaiser, C., Krakowiak, S., Mossière, J.: System design and implementation using parallel processes. In: IFIP Congress, vol. (1), pp. 345–352 (1971)

    Google Scholar 

  3. Brosgol, B.M.: A comparison of the concurrency features of ada 95 and java. In: SIGAda, pp. 175–192 (1998)

    Google Scholar 

  4. Buhr, P.A., Fortier, M., Coffin, M.H.: Monitor classification. ACM Comput. Surv. 27(1), 63–107 (1995)

    Article  Google Scholar 

  5. Dijkstra, E.W.: The structure of ”THE”-multiprogramming system. Commun. ACM 11(5), 341–346 (1968)

    Article  MATH  Google Scholar 

  6. Dijkstra, E.W.: Hierarchical ordering of sequential processes. In: Acta Informatica, vol. (1), pp. 115–138 (1971)

    Google Scholar 

  7. Evangelista, S., Kaiser, C., Pradat-Peyre, J.-F., Rousseau, P.: Quasar: a new tool for analyzing concurrent programs. In: Rosen, J.-P., Strohmeier, A. (eds.) Ada-Europe 2003. LNCS, vol. 2655, pp. 166–181. Springer, Heidelberg (2003)

    Google Scholar 

  8. Evangelista, S., Kaiser, C., Pradat-Peyre, J.-F., Rousseau, P.: Comparing Java, C# and Ada monitors queuing policies: a case study and its Ada refinement. Ada Letters XXVI(2), 23–37 (2006)

    Article  Google Scholar 

  9. Hartley, S.J.: Concurrent programming: the Java programming language. Oxford University Press, Inc., New York (1998)

    Google Scholar 

  10. Hoare, C.A.R.: Monitors: an operating system structuring concept. Commun. ACM 17(10), 549–557 (1974)

    Article  MATH  Google Scholar 

  11. Kaiser, C., Pradat-Peyre, J.F.: Comparing the reliability provided by tasks or protected objects for implementing a resource allocation service: a case study. In: TriAda, St. Louis, Missouri. ACM SIGAda (November 1997)

    Google Scholar 

  12. Kaiser, C., Pradat-Peyre, J.F.: Chameneos, a concurrency game for Java, Ada and others. In: Int. Conf. ACS/IEEE AICCSA 2003 (2003)

    Google Scholar 

  13. Lampson, B.W., Redell, D.D.: Experience with processes and monitors in mesa. Commun. ACM 23(2), 105–117 (1980)

    Article  Google Scholar 

  14. Lea, D.: Concurrent Programming in Java. Design Principles and Patterns, 2nd edn. Addison-Wesley, Reading (1999)

    MATH  Google Scholar 

  15. Potratz, E.: A practical comparison between java and ada in implementing a real-time embedded system. In: Leif, R.C., Sward, R.E. (eds.) SIGAda, pp. 71–83. ACM, New York (2003)

    Google Scholar 

  16. Tucker Taft, S., Duff, R.A., Brukardt, R., Plödereder, E., Leroy, P.: Ada 2005 Reference Manual. LNCS, vol. 4348. Springer, Heidelberg (2006)

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2009 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Kaiser, C., Pradat-Peyre, JF. (2009). Weak Fairness Semantic Drawbacks in Java Multithreading. In: Kordon, F., Kermarrec, Y. (eds) Reliable Software Technologies – Ada-Europe 2009. Ada-Europe 2009. Lecture Notes in Computer Science, vol 5570. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-642-01924-1_7

Download citation

  • DOI: https://doi.org/10.1007/978-3-642-01924-1_7

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-642-01923-4

  • Online ISBN: 978-3-642-01924-1

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics