Skip to main content

The Optimistic Readers Transformation

  • Conference paper
  • First Online:
ECOOP 2001 — Object-Oriented Programming (ECOOP 2001)

Part of the book series: Lecture Notes in Computer Science ((LNCS,volume 2072))

Included in the following conference series:

Abstract

Monitors, such as Java classes with synchronized methods, are a convenient and safe abstraction for designing and reasoning about multithreaded object-oriented programs. However, the straightforward implementation of monitors can be inefficient, particularly in programs in which the majority of calls are to read-only methods. We introduce the optimistic readers program transformation, which may be implemented either as a compiler optimization, or as a “design pattern.” This transformation produces an implementation whose observable behavior is equivalent to that of a monitor, but in which read-only methods do not acquire locks or perform any shared writes. As a result, programmers can reason about their programs as if each shared object were implemented using mutual exclusion, while achieving the performance benefits of unsynchronized reads. We present the program transformation using the platform-independent abstraction CRF. We then demonstrate the performance of this transformation as applied to benchmarks derived from the core module of a practical system — a Java-based publish-subscribe router. We compare the performance of the optimistic readers transformation to unoptimized synchronized methods and to reader and writer locks.

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

Access this chapter

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

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. Bacon, D. F., Strom, R. E., and Tarafdar, A., “Guava: A Dialect of Java without Data Races,” In OOPSLA 2000 Conference Proceedings, pp. 382–400, October 2000.

    Google Scholar 

  2. Gharachorloo, K. “Memory Consistency Models for Shared Memory Multiprocessors, ” PhD thesis, Stanford University, 1995.

    Google Scholar 

  3. Gosling, J., Joy, B., and Steele, G., The Java Language Specification. Addison Wesley, Menlo Park, CA, 1996.

    MATH  Google Scholar 

  4. Pugh, W., “ Fixing the Java Memory Model”. In Proceeedings of the ACM Java Grande Conference, June 1999.

    Google Scholar 

  5. Pugh, W., “Semantics of Multithreaded Java”, URL: http://www.cs.umd.edu/~pugh/java/memoryModel/semantics.pdf

  6. Maessen, J-W., Arvind, and Shen, X., “ Improving the Java Memory Model Using CRF”, In OOPSLA 2000 Conference Proceedings, pp. 1–12., October 2000.

    Google Scholar 

  7. Shen, X., Arvind, and Rudolph, L. “Commit-Reconcile and Fences (CRF): A New Memory Model for Architects and Compiler Writers” In Proceedings of the 26th International Symposium On Computer Architecture, Atlanta, Georgia, May 1999.

    Google Scholar 

  8. Java Memory Model Workshop, URL: http://www.cs.umd.edu/~pugh/java/memoryModel/workshop.

  9. Eswaran, K.P., Gray, J., Lorie, R. A., Traiger, I.L., “The Notions of Consistency and Predicate Locks in a Database System.” CACM 19(11), pp. 624–633, 1976.

    MATH  MathSciNet  Google Scholar 

  10. Banavar, G., Chandra, T., Mukherjee, B., Nagarajarao, J., Strom, R., and Sturman, D., “An Efficient Multicast Protocol for Content-based Publish-Subscribe Systems”, In Proceedings of the International Conference on Distributed Computing Systems, 1999.

    Google Scholar 

  11. Kung, H.T., and. Robinson, J.T., “On Optimistic Methods for Concurrency Control”, ACM TODS, v. 6, no. 2, pp. 213–226, June 1981.

    Google Scholar 

  12. Reiman, M., and. Wright, P.E., “Performance analysis of concurrent-read exclusivewrite”. In Joint International Conference on Measurement and Modeling of Computer Systems (ACM SIGMETRICS) San Diego, CA, Pages 168–177, May 1991.

    Google Scholar 

  13. Herlihy, M. “A Methodology for Implementing Highly Concurrent Data Objects.” ACM Transactions on Programming Languages and Systems, v. 15, no. 5, pp. 745–770, November 1993.

    Article  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2001 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Strom, R., Auerbach, J. (2001). The Optimistic Readers Transformation. In: Knudsen, J.L. (eds) ECOOP 2001 — Object-Oriented Programming. ECOOP 2001. Lecture Notes in Computer Science, vol 2072. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-45337-7_15

Download citation

  • DOI: https://doi.org/10.1007/3-540-45337-7_15

  • Published:

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-540-42206-8

  • Online ISBN: 978-3-540-45337-6

  • eBook Packages: Springer Book Archive

Publish with us

Policies and ethics