0

(this a dummy question)multiple processes are running in the background. my understanding is each CPU core can run only 1 process at a time. so someone has the ability to interrupt the current process(so the state of the process must be saved somewhere)(or the process itself does that) to run another one. when we have one core and in the current time a process is running, where is the other godfather process that watches these and handles the situation? what is the name of it? for example, we have two servers that are running on one PC with one core and listening on different ports. literally, this listening isn't a continuous job, the must be interrupted at least by another one, who handles this?

kankan256
  • 103
  • 2

1 Answers1

2

On Linux, all this is handled by the kernel scheduler. It doesn’t run all the time, but it can run whenever the kernel takes control.

See the following questions and answers for details:

Stephen Kitt
  • 434,908
  • As a more general answer, you might look this article, particularly at preemtive multitasking, for an OS agnostic overview. – doneal24 Feb 05 '22 at 20:17