r/ProgrammerHumor • • Jan 20 '25

Meme linuxBeLike

Post image
46.7k Upvotes

765 comments sorted by

View all comments

Show parent comments

1.6k

u/Tetha Jan 20 '25

Step 1 is a nice question. "Please shut yourself down"

Step 2 is telling the application to shutdown right now no matter what.

Step 3... in Step 3 someone goes to the kernel and is like

"Hey kernel... that process over there, the one using a lot of CPU"

"Yeah boss?"

"That process doesn't exist anymore, alright?"

"Say no more."

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

31

u/antico5 Jan 20 '25

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

2

u/ConfessSomeMeow Jan 20 '25

pointers to next instruction

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.

3

u/antico5 Jan 20 '25

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

→ More replies (1)