14.07.2013 Views

Contents - Cultural View

Contents - Cultural View

Contents - Cultural View

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Java collections framework 173<br />

References<br />

[1] http:/ / java. sun. com/ docs/ books/ tutorial/ collections/<br />

[2] http:/ / java. sun. com/ javase/ 6/ docs/ technotes/ guides/ collections/ index. html<br />

[3] http:/ / www. onjava. com/ pub/ a/ onjava/ excerpt/ javaian5_chap04/<br />

[4] http:/ / www. onjava. com/ pub/ a/ onjava/ excerpt/ javagenerics_chap05/<br />

[5] http:/ / www-128. ibm. com/ developerworks/ java/ library/ j-tiger07195/<br />

[6] http:/ / javalessons. com/ cgi-bin/ fun/ java-tutorials-main. cgi?sub=adv& ses=ao789<br />

[7] http:/ / www. collectionspy. com<br />

[8] http:/ / tutorials. jenkov. com/ java-collections/ index. html<br />

Java concurrency<br />

Java is a programming language (and API) which has been designed to support concurrent programming, and all<br />

execution in the language takes place in the context of a thread. It is important for a Java programmer to understand<br />

both the power and limitations of Java threads.<br />

In the JVM (Java Virtual Machine), objects and resources can be accessed by many separate threads; each thread has<br />

its own path of execution but can potentially access any object in the program. The programmer must ensure that<br />

threads do not interfere with each other, and that resources are properly coordinated (or "synchronized") during both<br />

read and write access. The Java language has built-in constructs to support this coordination.<br />

The Java Language Specification does not say how the JVM designer should implement the multithreading<br />

primitives specified, because there is so much variation among the various operating systems and hardware on which<br />

the JVM is expected to run.<br />

Monitor synchronization in Java<br />

The key synchronization concept in Java is the monitor. Every object in a JVM has a monitor associated with it.<br />

Such monitor-based concurrency was originally introduced with the Mesa programming language.<br />

Changes in Java 5<br />

Java 5 incorporated many additions and clarifications to the Java concurrency model. JSR 133 provided support for<br />

well-defined atomic operations in a multithreaded/multiprocessor environment, opening the door to JSR 166, a large<br />

battery of concurrent programming APIs.<br />

See also<br />

• Monitor (synchronization)<br />

• Concurrency (computer science)<br />

• Concurrency pattern<br />

• Doug Lea<br />

• Thread (computer science)

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!