ABSTRACT
We introduce Guava, a dialect of Java whose rules statically guarantee that parallel threads access shared data only through synchronized methods. Our dialect distinguishes three categories of classes: (1) monitors, which may be referenced from multiple threads, but whose methods are accessed serially; (2) values, which cannot be referenced and therefore are never shared; and (3) objects, which can have multiple references but only from within one thread, and therefore do not need to be synchronized. Guava circumvents the problems associated with today's Java memory model, which must define behavior when concurrent threads access shared memory without synchronization.We present an overview of the syntax and the semantic rules of Guava. We discuss how implementations of Guava can exploit these rules to re-enable compiler optimizations inhibited by standard Java. We discuss how compilers for certain multiprocessor architectures can automatically generate certain programming idioms, such as double-check reads, as optimizations of serialized monitors.
- 1.ALPHA ARCHITECTURE COMMITTEE. Alpha Architecture Reference Manual, third ed. Digital Press, 1998.]]Google Scholar
- 2.BRINCH HANSEN, P. Structured multiprograxnming. Commun. ACM 15, 7 (July 1972), 574-578.]] Google ScholarDigital Library
- 3.BRINCH HANSEN, P. The programming language Concurrent Pascal. IEEE Trans. Softw. Eng. SE-1, 2 (June 1975), 199-207.]]Google ScholarDigital Library
- 4.BRINCH HANSEN, P. The Solo operating system. Software - Practice and Experience 6, 2 (Apr.-June 1976), 141-200.]]Google Scholar
- 5.BRINCH HANSEN, P. Java's insecure parallelism. SIG- PLAN Notices 34, 4 (Apr. 1999), 38-45.]] Google ScholarDigital Library
- 6.CARDELLI, L., DONAHUE, J., GLASSMAN, L., JORDAN, M., KALSOW, B., AND NELSON, G. Modula-3 report. Tech. Rep. ORC-1, Olivetti Research Center, 1988.]]Google Scholar
- 7.CHAN, E. C., BOYLAND, J. T., AND SCHERLIS, W. L. Promises: Limited specifications for analysis and manipulation. In Proceedings of the IEEE International Conference on Software Engineering (ICSE 98) (Apr. 1998), pp. 167-176.]] Google ScholarDigital Library
- 8.DETLEFS, D. L., LEINO, K. R. M., NELSON, G., AND SAXE, J. B. Extended static checking. Tech. Rep. 159, Compaq Systems Research Center, http://www.resem'ch.digital.com/SRC, 1998.]]Google Scholar
- 9.FLANAGAN, C., AND ABADI, M. Object types against races. In CONCUR '99: Concurrency Theory, 10th International Conference (1999), Springer, pp. 288-303.]] Google ScholarDigital Library
- 10.FLANAGAN, C., AND ABADI, M. Types for safe locking. In Proceedings of the 8th European Symposium on Programming, ESOP '99 (Mar. 1999), Springer-Verlag, pp. 91-108.]] Google ScholarDigital Library
- 11.FLANAGAN, C., AND FREUND, S. N. Type-based race detection for java. In Proceedings of the ACM SIG- PLAN 2000 Conference on Programming Language Design and hnplementation (June 2000).]] Google ScholarDigital Library
- 12.GOSLING, J., JoY, B., AND STEELE, G. The Java Language Specification. Addison-Wesley, Reading, Mass., 1996.]] Google ScholarDigital Library
- 13.HOARE, C. A. R. Monitors: An operating system structuring concept. Commun. ACM 17, 10 (Oct. 1974), 549-557.]] Google ScholarDigital Library
- 14.HOARE, C. A. R. Communicating Sequential Processes. Prentice-Hall, Englewood Cliffs, New Jersey, 1985.]] Google ScholarDigital Library
- 15.HOGG, J. Islands: Aliasing protection in objectoriented languages. In Proceedings of the 1991 ACM Conference on Object Oriented Programming @stems, Languages, and Applications (OOPSLA) (Phoenix, Arizona, Oct. 1991), ACM Press, New York, New York.]] Google ScholarDigital Library
- 16.HOLT, R. C. Concurrent Euclid, the Unix System, and Tunis. Addison-Wesley, Reading, Mass., 1983.]]Google Scholar
- 17.JONES, G. Programming in occam. Prentice-Hall, Englewood Cliffs, New Jersey, 1987.]] Google ScholarDigital Library
- 18.KUNG, H. T., AND ROBINSON, J. T. On optimistic methods for concurrency control. ACM Transactions on Database Systems 6, 2 (June 1981).]] Google ScholarDigital Library
- 19.LUCASSEN, J. M., AND GIFFORD, D. K. Polymorphic effect systems. In Conference Record of the Fifteenth Annual ACM Symposium on Principles of Programruing Languages (Jan. 1988), ACM SIGPLAN Notices, ACM Press.]] Google ScholarDigital Library
- 20.MAY, C., SILHA, E., SIMPSON, R., AND WARREN, H., Eds. The PowerPC Architecture. Morgan Kaufmann, 1994.]]Google Scholar
- 21.PUGH, W. Fixing the Java memory model. In Proceedings of the ACM Java Grande Conference (San Francisco, 1999).]] Google ScholarDigital Library
- 22.REYNOLDS, J. C. Synactic control of interference. In Conference Record of the Fifth ACM Symposium on Principles of Programming Languages (Tucson, Arizona, Jan. 1978), ACM Press, New York, New York, pp. 39-46.]] Google ScholarDigital Library
- 23.SCHMIDT, D. C., AND HARRISON, T. Double-checked locking. In Pattern Languages of Program Design 3 (Reading, Mass., 1998), Addison-Wesley, pp. 363-375.]] Google Scholar
- 24.STROM, R. E., BACON, D. F., GOLDBERG, A., LOWRY, A., YELLIN, D., AND YEMINI, S. A. Hermes: A Language for Distributed Computing. Series in Innovative Technology. Prentice-Hall, Englewood Cliffs, New Jersey, 1991.]] Google ScholarDigital Library
- 25.WEAVER, D. L., AND GERMOND, T., Eds. The SPARC Architecture Manual, Version 9. Prentice Hall, 1994.]] Google ScholarDigital Library
- 26.WroTH, N. Design and implementation of Modula. Software - Practice and Experience 7, 1 (Jan.-Feb. 1977), 67-s4.]]Google Scholar
- 27.WroTH, N. Modula: a language for modular multiprogramming. Software - Practice and Experience 7, 1 (Jam-Feb. 1977), 3-35.]]Google Scholar
Index Terms
- Guava: a dialect of Java without data races
Recommendations
Guava: a dialect of Java without data races
We introduce Guava, a dialect of Java whose rules statically guarantee that parallel threads access shared data only through synchronized methods. Our dialect distinguishes three categories of classes: (1) monitors, which may be referenced from multiple ...
Deadlock freedom through object ownership
IWACO '09: International Workshop on Aliasing, Confinement and Ownership in Object-Oriented ProgrammingActive objects are an attractive method of introducing concurrency into Java-like languages by decoupling method execution from invocation. In this paper, we show how ownership is used in the Java [14] subset language CoJava [17] to prevent deadlock ...
PACER: proportional detection of data races
PLDI '10: Proceedings of the 31st ACM SIGPLAN Conference on Programming Language Design and ImplementationData races indicate serious concurrency bugs such as order, atomicity, and sequential consistency violations. Races are difficult to find and fix, often manifesting only after deployment. The frequency and unpredictability of these bugs will only ...
Comments