JAVAThread multi-thread Learning
I learned java for the second time and found that many knowledge points were not understood before. In the java multi-Thread section, we learned not only to inherit the Thread to implement the runnable interface, but also the third Thread method based on the Thread pool to implement the callable interface. I feel that java is truly profound and profound. Summary of java thread notes:
A java thread is called a single-threaded program. A java program is called a multi-threaded program after multiple programs are executed.
1: Multithreading
(1) multithreading: an application has multiple execution paths. Process: The application thread being executed: The Execution Unit of the process. The execution path is single thread: one application has only one execution path and multiple threads: one application has multiple execution paths.
What is the significance of multi-process? What is the significance of improving CPU usage by multithreading? Improve Application Usage (2) How Java programs run and does JVM start multithreading? A: run the Java command to start JVM. JVM starts A process that starts A main thread. B: JVM startup is multi-threaded, because it has two threads at least, the main thread and the garbage collection thread.
(3) multi-Thread implementation solution A: Inheriting Thread class B: Implementing the Runnable interface
* Comparison of the two methods
(4) thread scheduling and priority problem A: Thread Scheduling