Home:ALL Converter>What is the difference in scheduling threads?

What is the difference in scheduling threads?

Ask Time:2021-04-22T14:35:53         Author:Yujie

Json Formatter

I am currently learning about simultaneous multi-threading, multi-core and multi-processor scheduling of threads. I checked some information, my understanding is:

If there is a processor that supports simultaneous multi-threading, it turns one physical core into two logical cores. There are two processes, P1 and P2.

  1. My understanding: In Linux, each process is composed of at least one thread? So scheduling is based on thread scheduling?

P1 and P2 are respectively scheduled to two logical cores. They operate independently. This is the first situation. If there is a process P3, it consists of two threads t1 and t2. Schedule t1 and t2 to different logical cores respectively. So what is the difference between scheduling two different processes to separate logical cores and scheduling different threads in the same process to logical cores?

  1. My understanding: The process is the smallest unit of the system to allocate resources, and threads share the resources of the process. Threads in a process share virtual memory, PCB, and can access the same data. Therefore, when scheduling different threads in a process and scheduling threads in different processes, there is no difference for the processor. The difference lies in the address translation of the page table and whether the cache can be shared. For a multi-core processor, the processor does not care whether the threads belong to the same process. The consistency of the data is guaranteed by MESI. The physical location of the data is guaranteed by the page table.

Is my understanding correct?

Author:Yujie,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/67207962/what-is-the-difference-in-scheduling-threads
yy