Java Multithreaded Programming (1) Java Multithreaded Skills

  1. The concept of process and multithreading and the advantages of threads

  Open the Windo task manager and you can see a lot of running exe programs. You can fully understand the exe files running in the memory as processes. The process is the basic running unit managed by the operating system.

  Threads can be understood as subtasks that run independently in a process. For example, when QQ.exe is running, there are many subtasks running at the same time.

  Using threads, you can maximize the idle time of the CPU to process other tasks, the CPU is constantly switching between characters, and because the switching speed is very fast, people feel that these tasks are running at the same time. In other words, you can run more different kinds of tasks at the same time, which can greatly increase the utilization of the CPU.

  Second, the use of multi-threading

  There is at least one thread running when a process is running.

  

  three,

  Four,

  Fives,

  six, 

  Seven, stop the thread

  8. Pause the thread

  Nine,  

  10. Thread priority

  11. Guardian thread

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325140883&siteId=291194637