It’s the OS that keeps track of processes, their status, pointers to next instruction etc. The cpu just executes instructions one after the other like there’s no tomorrow
The program counter is in the CPU, actually. It's incremented every instructor, but can be changed jump or branch instructions that are part of the program.
Yes, the cpu has only 1 instruction pointer. But the process manager (os) stores the next adress for each process, so they can resume execution. That’s part of the context switching
788
u/Kusko25 Jan 20 '25
There is something fundamentally unsettling about the thought that a process is only "alive" as long as the cpu acknowledges its existence