Contents |
Java is a programming language (and API) which has been designed to support concurrent programming, and all execution in the language takes place in the context of a thread. A programming language is an Artificial language that can be used to write programs which control the behavior of a machine particularly a Computer. Concurrent computing is the concurrent (simultaneous execution of multiple interacting computational tasks It is important for a Java programmer to understand both the power and limitations of Java threads.
In the 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. A Java Virtual Machine ( JVM) is a set of computer software programs and data structures which use a Virtual machine A Java Virtual Machine ( JVM) is a set of computer software programs and data structures which use a Virtual machine A thread in Computer science is short for a thread of execution. The programmer must ensure that threads do not interfere with each other, and that resources are properly coordinated (or "synchronized") during both read and write access. In Computer science, synchronization refers to one of two distinct but related concepts synchronization of processes, and synchronization of data The Java language has built-in constructs to support this coordination.
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. Multithreading computers have hardware support to efficiently execute multiple threads. An operating system (commonly abbreviated OS and O/S) is the software component of a Computer system that is responsible for the management and coordination Hardware is a general term that refers to the physical artifacts of a Technology.
The key synchronization concept in Java is the monitor. In Computer science, synchronization refers to one of two distinct but related concepts synchronization of processes, and synchronization of data A monitor is an approach to synchronize two or more computer tasks that use a shared resource usually a hardware device or a set of Variables With monitor-based Every object in a JVM has a monitor associated with it. Such monitor-based concurrency was originally introduced with the Mesa programming language. Mesa is a programming language developed at Xerox PARC. The name Mesa was a pun referring to its design intent to be a "high-level"
Java 5 incorporated many additions and clarifications to the Java concurrency model. JSR 133 provided support for well-defined atomic operations in a multithreaded/multiprocessor environment, opening the door to JSR 166, a large battery of concurrent programming APIs.