JAVA Guide: Analysis of Java multi-threading mechanism (2)
Abstract: JAVA Guide: Analysis of Java multi-threading mechanism (2)
: Process and the difference between Java application threads in the process of implementing the existence of a memory address of the initial point of entry, a procedure in the implementation of the code execution sequence, as well as marking the end of the process for the memory address of the point of export, in the process of implementation in the course of each point in time are the only processor instructions and memory modules corresponding address.
Java language in the definition of threads (Thread) the same point of entry, including a memory address, a point of export, as well as to address the implementation of the order of the code sequence. However, the process and the important difference between the threads can not separate thread implementation, it must be running activities in the state in the application process, and therefore can be defined thread is a process complicated by the internal code of the order flow.
Unix operating system and Microsoft Windows operating system to support multi-user, multi-process with the implementation of the Java language support and application process multiple execution threads within the concurrent execution. Multithreading is the significance of an application process with a number of logic elements can be implemented. However, multi-threading does not mean that the number of users in the implementation process, not the operating system each thread as a separate independent process to allocate system resources. Process can create his son process, the process of process and father have different executable code and data memory space. In applications for representatives of a number of threads in the process of shared data memory space, while maintaining the independence of each thread stack and procedures for the implementation of the implementation of the context (Context).
Based on the above distinction, also known as light-threaded process (Light Weight Process, LWP). Different tasks threads allow collaboration and data exchange, makes the consumption of resources, such as computer systems are very cheap.
Thread need the support of the operating system, not all types of computer support for multi-threaded applications. Java programming language support and will be threaded together language runtime environment, providing multi-task with the implementation of capacity. This is like a person in the household chores in the process of washing machines will be put in the clothes after washing rice on the automatic rice cooker, and then start cooking. , And so do the dishes, cooked a meal at the same time also wash clothes better.
It must be noted that: the use of procedures in the application of multi-threaded CPU will not increase data processing capacity. Only in the multi-CPU computer or network computing architecture, will be divided into a number of Java programs with execution threads, multiple threads running start at the same time, so that the different threads running on different processors based on the Java virtual machine in order to improve the efficiency of applications.
Switched from: Reuters Java, java, J2SE, j2se, J2EE, j2ee, J2ME, j2me, ejb, ejb3, JBOSS, jboss, spring, hibernate, jdo, struts, webwork, ajax, AJAX, mysql, MySQL, Oracle, Weblogic, Websphere, scjp, scjd
↑ Back






