Semicolony ELI5 · comic

Process vs thread.

A process is a kitchen; threads are the cooks working inside it.

  1. My kitchen, my rules.
    PROCESS A PROCESS B
    1

    Each process is its own walled-off kitchen, with its own private supplies.

  2. Two of us on this order.
    ONE PROCESS thread thread
    2

    Inside one kitchen, threads are the cooks actually doing the work.

  3. shared counter
    3

    They share the same counter and shelves, so handing work back and forth is quick.

  4. I had it first!
    both at once! race!
    4

    But two cooks reaching for the same pot at once is where it goes wrong (a race).

  5. Wait for the token.
    waits its turn
    5

    So they take turns: a lock means only one cook touches the shared pot at a time.

  6. processes safe, heavy threads fast, need care
    6

    Separate kitchens are safe but heavy; cooks in one kitchen are fast but need care.

A process is the kitchen; threads are the cooks inside it. Sharing one counter is fast — and easy to fumble.
Semicolony semicolony.dev/eli5/process-vs-thread/comic
← All ELI5 explainers