Abstract
Programming with Java monitors is recognized to be difficult, and potentially inefficient due to many useless context switches induced by the notifyAll primitive. This paper presents SOM, Sequential Object Monitors, as an alternative to programming with Java monitors.
Reifying monitor method calls as requests, and providing full access to the pending request queue, gives rise to fully sequential monitors: the SOM programmer gets away from any code interleaving. Moreover, useless context switches are avoided. Finally, from a software engineering point of view, SOM promotes separation of concerns, by untangling the synchronization concern from the application logic.
This paper illustrates SOM expressiveness with several classical concurrency problems, and high-level abstractions like guards and chords. Benchmarks of the implementation confirm the expected efficiency.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Preview
Unable to display preview. Download preview PDF.
Similar content being viewed by others
References
Agha, G.: ACTORS: a model of concurrent computation in distributed systems. The MIT Press, Cambridge (1986)
America, P.H.M., Van Der Linden, F.: A parallel object-oriented language with inheritance and subtyping. In: Meyrowitz, N. (ed.) Proceedings of the OOPSLA/ECOOP 1990 Conference on Object-Oriented Programming Systems, Languages and Applications, October 1990. ACM SIGPLAN Notices, vol. 25(10), ACM Press, New York (1990)
Atkinson, C., Maio, A.D., Bayan, R.: Dragoon: An object-oriented notation supporting the reuse and distribution of ada software. In: International Workshop on Real-Time Ada Issues (1990)
Benton, N., Cardelli, L., Fournet, C.: Modern concurrency abstractions for c\({}^{\sharp}\). In: Magnusson, B. (ed.) ECOOP 2002. LNCS, vol. 2374, p. 415. Springer, Heidelberg (2002)
Birtwistle, G.M., Dahl, O.-J., Myhrhaug, B., Nygaard, K.: Simula Begin. Petrocelli Charter (1973)
Hansen, P.B.: Structured multiprogramming. Communications of the ACM 15(7), 574–578 (1972)
Hansen, P.B.: A programming methodology for operating system design. In: Proceedings of the IFIP Congress 1974, August 1974, pp. 394–397. North-Holland, Amsterdam (1974)
Hansen, P.B.: Monitors and concurrent pascal, a personal history. ACM SIGPLAN Notices 28(3), 1–35 (1993)
Briot, J.-P., Guerraoui, R., Löhr, K.-P.: Concurrency and distribution in object-oriented programming. ACM Computing Surveys 30(3), 291–329 (1998)
Caromel, D.: Towards a method of object-oriented concurrent programming. Communications of the ACM 36(9), 90–102 (1993)
Caromel, D., Klauser, W., Vayssière, J.: Towards seamless computing and metacomputing in Java. Concurrency Practice and Experience 10(11-13), 1043–1061 (1998)
Dijkstra, E.W.: The structure of THE - multiprogramming system. Communications of the ACM 11(5), 341–346 (1968)
Dijkstra, E.W.: Guarded commands, nondeterminacy and formal derivation of programs. Communications of the ACM 18(8), 453–457 (1975)
Fournet, C., Gonthier, G.: The reflexive chemical abstract machine and the join-calculus. In: Proceedings of POPL 1996, January 1996, pp. 372–385. ACM, New York (1996)
Frolund, S., Agha, G.: A language framework for multi-object coordination. In: Nierstrasz, O. (ed.) ECOOP 1993. LNCS, vol. 707, pp. 346–360. Springer, Heidelberg (1993)
Hoare, C.A.R.: Monitors: An operating system structuring concept. Communications of the ACM 17(10), 549–577 (1974)
Hoare, C.A.R.: Communicating sequential processes. Communications of the ACM 21(8), 666–677 (1978)
Kaubisch, W.H., Perrott, R.H., Hoare, C.A.R.: Quasi-parallel programming. Software: Practice and Experience 6(3), 341–356 (1976)
Lea, D.: Concurrent Programming in Java, Design Principles and Patterns. Addison Wesley, Reading (1997)
Lea, D.: A Java fork/join framework. In: Proceedings of the ACM 2000 Conference on Java Grande, San Francisco, California, USA, pp. 36–43 (2000)
Lea, D.: Java Specification Request 166: Concurrency utilities (2003), http://www.jcp.org/en/jsr/detail?id=166
Odersky, M.: Functional nets. In: Smolka, G. (ed.) ESOP 2000. LNCS, vol. 1782, pp. 1–25. Springer, Heidelberg (2000)
Sun Microsystems, Inc. The producer/consumer example, from Java tutorials (2003), http://java.sun.com/docs/books/tutorial/essential/threads
Tanter, E., Noyé, J., Caromel, D., Cointe, P.: Partial behavioral reflection: Spatial and temporal selection of reification. In: Proceedings of the 18th International Conference on Object-Oriented Programming Systems, Languages and Applications (OOPSLA 2003), Anaheim, CA, USA, October 2003. ACM SIGPLAN Notices, vol. 38(11), pp. 27–64. ACM Press, New York (2003)
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2004 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Caromel, D., Mateu, L., Tanter, É. (2004). Sequential Object Monitors. In: Odersky, M. (eds) ECOOP 2004 – Object-Oriented Programming. ECOOP 2004. Lecture Notes in Computer Science, vol 3086. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-540-24851-4_15
Download citation
DOI: https://doi.org/10.1007/978-3-540-24851-4_15
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-22159-3
Online ISBN: 978-3-540-24851-4
eBook Packages: Springer Book Archive