Skip to content
Optimal Lab

Operating systems and concurrency

See what the computer does underneath your program.

Sessions

Go in order. Each session is one idea you can drag, step and break.

01How a computer runs code

2 live · 3 coming

The CPU, memory and the kernel.

  1. Interactive

    Coming soon

    The CPU: fetch, decode, execute

    One instruction at a time, billions of times a second.

  2. Interactive

    Live

    Registers, caches and RAM

    Why some reads take 1 ns and others 100 ns.

    Open session →

  3. Interactive

    Live

    Cache lines and locality

    Why looping over an array the right way is faster.

    Open session →

  4. Interactive

    Coming soon

    Numbers in binary

    Integers, overflow and why 0.1 + 0.2 isn't 0.3.

  5. Interactive

    Coming soon

    System calls

    How a program asks the kernel to do things.

02Processes and threads

1 live · 5 coming

Running many programs at once.

  1. Interactive

    Coming soon

    Processes

    A running program: its memory, files and state.

  2. Interactive

    Coming soon

    Threads

    Several paths of execution sharing one process.

  3. Interactive

    Coming soon

    Context switching

    What it costs to switch from one thread to another.

  4. Interactive

    Live

    CPU scheduling

    Who runs next: round robin, priorities and fairness.

    Open session →

  5. Interactive

    Coming soon

    fork and exec

    How a new process is started on Unix.

  6. Interactive

    Coming soon

    Inter-process communication

    Pipes, sockets, shared memory and signals.

03Memory

2 live · 4 coming

Where your program's data lives.

  1. Interactive

    Coming soon

    Stack vs heap

    Function frames and longer-lived data.

  2. Interactive

    Live

    Virtual memory and paging

    Every process thinks it has the whole memory to itself.

    Open session →

  3. Interactive

    Coming soon

    Page faults and swapping

    What happens when memory isn't really there yet.

  4. Interactive

    Coming soon

    Memory allocation

    How malloc finds space, and fragmentation.

  5. Interactive

    Live

    Garbage collection

    Mark and sweep, generations and pauses.

    Open session →

  6. Interactive

    Coming soon

    Memory leaks

    Memory nobody frees, and how to find it.

04Concurrency

3 live · 4 coming

Many things at once, without corrupting data.

  1. Interactive

    Live

    Race conditions

    Two threads update one counter and lose an increment.

    Open session →

  2. Interactive

    Coming soon

    Mutexes and critical sections

    Let one thread in at a time.

  3. Interactive

    Coming soon

    Semaphores

    Let up to N threads in at once.

  4. Interactive

    Live

    Deadlocks

    Two threads each hold what the other needs.

    Open session →

  5. Interactive

    Live

    Condition variables and producer-consumer

    Wait for work without spinning.

    Open session →

  6. Interactive

    Coming soon

    Atomics and lock-free code

    Compare-and-swap and updates without locks.

  7. Interactive

    Coming soon

    Thread pools

    A fixed set of workers pulling from a queue.

05Async and parallel models

1 live · 4 coming

Different ways to do many things.

Already live in other tracks: The event loop, phase by phase, The libuv thread pool

  1. Interactive

    Coming soon

    Blocking vs non-blocking I/O

    Wait for the disk, or ask to be told when it's ready.

  2. Interactive

    Live

    Event loops and epoll

    One thread watching thousands of connections.

    Open session →

  3. Interactive

    Coming soon

    Async vs threads

    Two models for concurrency, and the costs of each.

  4. Interactive

    Coming soon

    Concurrency vs parallelism

    Juggling tasks vs doing them at the same moment.

  5. Interactive

    Coming soon

    Actors and channels

    Share by communicating instead of sharing memory.

06Files and storage

0 live · 4 coming

What happens when you write to disk.

Already live in other tracks: The write-ahead log

  1. Interactive

    Coming soon

    File systems and inodes

    How files, directories and metadata are stored.

  2. Interactive

    Coming soon

    File descriptors

    The numbers that stand for open files and sockets.

  3. Interactive

    Coming soon

    Disk I/O and the page cache

    Why a write returns before it reaches the disk.

  4. Interactive

    Coming soon

    fsync and durability

    Forcing data onto the disk, and what it costs.

07Virtualization and containers

0 live · 2 coming

Many machines on one machine.

Already live in other tracks: Containers vs virtual machines

  1. Interactive

    Coming soon

    Virtual machines and hypervisors

    Run whole operating systems side by side.

  2. Interactive

    Coming soon

    Namespaces and cgroups

    The kernel features that make a container.

In production

Tools you can use

26 technologies across 9 live sessions. Same names in any language — pick a session to see how the idea maps to the real world.

Services, platforms, protocols and standards — not one stack.

Roadmap

Coming soon

A step-by-step path through the track, with sessions and practice at each stage.

  1. Stage 1

    How a computer runs code

  2. Stage 2

    Processes, threads and memory

  3. Stage 3

    Concurrency

  4. Stage 4

    Async models

  5. Stage 5

    Files, storage and virtualization

Projects

Coming soon

Build something real to lock in the skill.

  • Write a thread-safe queue
  • Find and fix a deadlock
  • Profile a program that's slow for no obvious reason