Home > Back-end >  Help multithreaded problem
Help multithreaded problem

Time:10-06

Thread is refers to the process of tasks, or refers to the process of task, task should be the CPU execution, but the thread of execution unit is defined? Still say thread is a place of the CPU processing tasks,

CodePudding user response:

From the process point of view, the thread is divided from the process to perform a task, so the thread is the executor of the task, that is what you are saying the execution of the unit, the CPU is the processor, its task is responsible for processing instructions, and thread is the instruction of issuers, so task at the end of the day or are done by a thread, no thread to give the instruction, the CPU also don't know what to do,
From the point of view of the CPU, it does not need to know from which thread to the current instruction, just need to know what kind of instruction execution is going to have to fetch the data memory area do what operation can, these data are threads prepared, so could have an exclusive for CPU thread,

CodePudding user response:

Thread is in the operation of a program that process is an instance of a process execution, belongs to the process, at the same time is a basic unit of the CPU scheduling and distribution, physical structure, the number of CPU core simulation threads, CPU core is real physics, and the thread is a kind of logical structure, under the hyper-threading technology, a core may correspond to multiple threads, but the thread is the task of the real execution unit, this is true, you can understand for, the CPU is the thread scheduling, distributor, the real mission is thread, this relationship is really a little bit strange, actually you can easy to understand is that the CPU like the human brain, really do things or by your brain actually request let your hands do,

CodePudding user response:

Multithreaded involves a lot of problems, are you want to know what kind of problem
  • Related