R

ReflexKR

Reflex Docs

Concurrency in the Late-Night Kitchen

·

Course overview

1

The first night's queue: concurrency and parallelism

2

Hiring more cooks: threading basics

3

The chalkboard is wrong: race conditions and Lock

4

Only three burners: synchronization tools

5

Knives and boards: deadlock

6

The ticket rail: queue

7

Agency cooks: concurrent.futures

8

Why the dough won't go faster: the GIL and parallelism

9

One floor manager for every table: first steps in asyncio

10

The group booking falls through: structured concurrency

11

The floor freezes: blocking calls and mixing tools

12

The critic's night: putting it all together

Concurrency in the Late-Night Kitchen

Course overview

Become the new sous-chef at the late-night diner Dongsi and learn threading, multiprocessing and asyncio over twelve services, watching every task on a live kitchen timeline. A 10-hour course.

10 hours12 lessonsReflex 0.10.0

At the end of an alley in Mangwon-dong, Seoul, there is a small place whose lights come on at ten at night. The sign says Dongsi, a late-night diner. Its owner, Chef Yoon Seoyeon, spent twenty years building servers as a backend developer, and she still talks about her kitchen that way: "A kitchen is a program."

As of tonight, you are the new sous-chef. Over twelve services in the diner's first month, this 10-hour course teaches you the three Python tools for doing several things at once:

  • threading: put more cooks in the kitchen.
  • multiprocessing (and concurrent.futures): open more kitchens.
  • asyncio: one person gets other work done while waiting.

The people in the kitchen

WhoWhat they do
Chef Yoon SeoyeonOwner and head chef. Wears a timer around her neck. Hands you a ticket every night and leaves a recipe card at closing.
MinhoLine cook. Fast, but careless.
SuaLine cook. Meticulous.
Mr. TakLine cook. Slow, but never makes a mistake.
LouFloor manager. Runs the whole dining room alone. Nickname: "the Event Loop". Takes center stage from Lesson 9.

And on the last night of the month, a food critic arrives in disguise.

How a night goes

  1. You get tonight's ticket, with the night's trouble and the goal written on it.
  2. You learn the concepts and the code alongside the chef.
  3. You run the kitchen yourself on the kitchen timeline. It is not an animation: real threads and real asyncio run on the server, and every task is drawn as a bar from the moment it actually started to the moment it actually finished.
  4. When service ends, the day's tools go onto the chef's recipe card, one line each.
PartLessonsThe kitchen
Many cooks1–7threads, race conditions, locks, deadlock, queues, worker pools
Many kitchens8the GIL, processes, GIL-free 3.14t, subinterpreters
One manager on the floor9–11asyncio, TaskGroup, cancellation and timeouts, blocking
The critic's night12every tool in one kitchen

Each lesson is a complete night on its own, so feel free to pick just the nights you need.

What you need

  • Working Python: functions, classes, with, exception handling. If you finished the regex course on this site, you are ready.
  • Python 3.14. Every example was run and checked on 3.14. Results from the free-threaded build without the GIL (3.14t) are included too.
  • The kitchen timeline runs right here on the page. To run the examples yourself, save them as a .py file and run python file.py. The multiprocessing examples in particular need to run from a file, not the interactive shell.

Chef's tip

You won't get a feel for concurrency just by reading code. Run the timelines yourself. Once you see how the bars overlap, you're halfway there.

Next →

Lesson 1 · The first night's queue: concurrency and parallelism

Get news about new lessons

We'll email you when this course gets new lessons or a follow-up course opens.

We collect: your email address · Purpose: news about new lessons or the launch of this course · Kept until: you ask us to remove it. We never use it for anything else or share it. Reply to any notice email and we'll delete it right away.

Questions & answers

Ask anything about this lesson. Questions from every language version of this page appear together.

Shown as plain text, without links or formatting.

R

ReflexKR

Learn Python and Reflex by doing. Every example was run and verified on Reflex 0.10.0.

ReflexKR is free, with no banner ads. If it helped you, you can support it with a coffee. ☕ Buy us a coffee

Affiliate disclosure
한국어English日本語简体中文EspañolDeutsch

© 2026 ReflexKR · Since 2026 · CC BY-NC 4.0

Built with Reflex