Java concurrency
Java is a programming language, which has been designed to support concurrency programming. As a matter of fact everything that executes in java program is the result of a thread executing a method associated with an object.
It is important to know that even though it is possible to use threads in java there are various limitations because of variations in the underlying operating systems. Having said that, it is essential for a Java programmer to understand both the power and limitations of Java threads.
In JVM (java virtual machine) 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. Programmer has to ensure that threads do not interfere with each other, resources are properly synchronized on both read and write access. Java language has built-in constructs that make this relatively easy, but the biggest difficulty in concurrency programming is to think with concurrency in mind while designing a program than only knowing language constructs, concurrency helper classes or concurrency patterns. Having said that, despite a significant number of help from java built-in language constructs and number of java platform concurrency classes, programmer will need to put some effort into becoming comfortable with multithreading.
Java language specification does not say how the JVM should implement multithreading because there is so much variation among the various operating systems and hardware on which Java is expected to run, the language specification leaves the specific implementation up to JVM designers.