Programming foundations

Stage 3 · Lesson 9 of 9

Processes and the operating system

How computers run your code

The (OS) sits between your program and the hardware. When you run a program, the OS creates a process: a running instance of the program with its own memory, open files and at least one thread of execution. The OS shares time between hundreds of processes by switching between them very quickly.

Your code asks the OS for anything outside its own memory, such as reading a file, opening a network connection or printing. It does this through . Threads are separate paths of execution inside one process, and they share its memory.

That is powerful, and also a source of hard bugs. This is what makes task managers, kill, and "permission denied" errors make sense.

A question to check yourself, an AI practice session and 1 cheat sheet entry come when you add the roadmap to your account. Add it

Resources for this stage

Start with· follow one of these

Keep handy

  • Quick explanations of OS basics like processes and memory when a lecture skips a step

Also worth your time

  • Everything from a key press to a rendered page; read it after this stage

Mark this stage as not done?