Java concurrency

Java concurrency

The Java language and the JVM (Java Virtual Machine) have been designed to support concurrent programming, and all execution in takes place in the context of threads. Objects and resources can be accessed by many separate threads; each thread has its own path of execution but can potentially access any object in the program. The programmer must ensure read and write access to objects is properly coordinated (or "synchronized") between threads. Thread synchronization ensures that objects are modified by only one thread at a time and that threads are prevented from accessing partially updated objects during modification by another thread. The Java language has built-in constructs to support this coordination.

Contents

Monitor synchronization in Java

The key synchronization concept for JVM concurrency is the monitor. Every object in a JVM has a monitor associated with it. Such monitor-based concurrency was originally introduced with the Mesa programming language.

The Java Language Specification does not say how the JVM designer should implement the multithreading primitives specified, because there is so much variation among the various operating systems and hardware on which the JVM is expected to run.

History

Since JDK 1.2, Java has included a standard set of collection classes, the Java collections framework

Doug Lea, who also participated in the Java collections framework implementation, developed a concurrency package, comprising several concurrency primitives and a large battery of collection-related classes[1]. This work was continued and updated as part of JSR 166 which was chaired by Doug Lea.

JDK 5.0 incorporated many additions and clarifications to the Java concurrency model. The concurrency APIs developed by JSR 166 were also included as part of the JDK for the first time. JSR 133 provided support for well-defined atomic operations in a multithreaded/multiprocessor environment.

Both the Java SE 6 and Java SE 7 releases introduced updated versions of the JSR 166 APIs as well as several new additional APIs.

See also

Notes

  1. ^ Doug Lea. "Overview of package util.concurrent Release 1.3.4". http://gee.cs.oswego.edu/dl/classes/EDU/oswego/cs/dl/util/concurrent/intro.html. Retrieved 2011-01-01. "Note: Upon release of J2SE 5.0, this package enters maintenance mode: Only essential corrections will be released. J2SE5 package java.util.concurrent includes improved, more efficient, standardized versions of the main components in this package." 

References

  • Goetz, Brian; Joshua Bloch, Joseph Bowbeer, Doug Lea, David Holmes, Tim Peierls (2006). Java Concurrency in Practice. Addison Wesley. ISBN 0-321-34960-1. 
  • Lea, Doug (1999). Concurrent Programming in Java: Design Principles and Patterns. Addison Wesley. ISBN 0-201-31009-0. 

External links


Wikimedia Foundation. 2010.

Игры ⚽ Поможем решить контрольную работу

Look at other dictionaries:

  • Java collections framework — class and interface hierarchy of java.util.Collection class and interface hierarchy …   Wikipedia

  • Java Platform, Enterprise Edition — or Java EE is a widely used platform for server programming in the Java programming language. The Java EE Platform differs from the Standard Edition (SE) of Java in that it adds libraries which provide functionality to deploy fault tolerant,… …   Wikipedia

  • Java backporting tools — are programs (usually written in Java) that convert Java classes bytecodes from one version of the Java Platform to an older one (for example Java 5.0 backported to 1.4). Contents 1 Java backporting tools comparison 1.1 Main information 1.2… …   Wikipedia

  • Java Specification Request — Java Specification Requests Java Specification Requests (JSR) est un système normalisé ayant pour but de faire évoluer la plateforme Java. Sommaire 1 Présentation 2 Implémentation 3 Interopérabilité informatique …   Wikipédia en Français

  • Java Specification Requests — (JSR) est un système normalisé ayant pour but de faire évoluer la plateforme Java. Sommaire 1 Présentation 2 Implémentation 3 Liste des JSRs 4 Notes et …   Wikipédia en Français

  • Concurrency and Coordination Runtime — (CCR) is an asynchronous programming library based on .NET Framework from Microsoft distributed with Microsoft Robotics Developer Studio (MRDS). Even though it comes with MRDS, it is not limited to modelling robotic behavior but can be used to… …   Wikipedia

  • Java Card — est un environnement d exécution Java destiné aux applications pour Carte à puce. Cette technologie fournit un environnement sécurisé pour les applications qui fonctionnent sur ce support de capacité mémoire et de traitement limitées. De… …   Wikipédia en Français

  • Concurrency and Coordination Runtime — (CCR)  библиотека для работы с параллельными и асинхронными потоками данных, базирующаяся на .NET Framework от Microsoft, поставляемая в комплекте с Microsoft Robotics Developer Studio (MS RDS). Несмотря на то что данная библиотека… …   Википедия

  • Java performance — Programs written in Java have had a reputation for being slower and requiring more memory than those written in natively compiled languages such as C or C++ (see e.g. [cite web url=http://www.jelovic.com/articles/why java is slow.htm title=Why… …   Wikipedia

  • Concurrency (computer science) — The Dining Philosophers , a classic problem involving concurrency and shared resources In computer science, concurrency is a property of systems in which several computations are executing simultaneously, and potentially interacting with each… …   Wikipedia

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”