← Lessons

quiz vs the machine

Platinum1820

Concurrency

Dataflow Programming

Computation as a graph where data readiness drives execution.

6 min read · advanced · beat Platinum to climb

Execution driven by data

In dataflow programming you express a computation as a graph of operations connected by edges that carry values. A node fires as soon as all its inputs are available, not in a fixed line by line order. The schedule emerges from data readiness.

Implicit parallelism

Because a node only depends on its inputs, two nodes with no path between them are independent and can run at the same time. You never write explicit threads; the parallelism falls out of the graph shape. The runtime walks the graph and runs whatever is ready.

Single assignment variables

A clean way to build dataflow is the single assignment or dataflow variable: it starts empty, can be bound once, and any reader that touches it before it is bound simply blocks until a value arrives. This gives synchronization for free with no locks, because a variable is either unbound or settled forever.

Deterministic by construction

If every variable is bound once and nodes are pure, the graph is deterministic: the same inputs always produce the same outputs regardless of how the runtime schedules nodes. Timing cannot change the result, which makes dataflow programs much easier to reason about than thread and lock code.

Key idea

Dataflow programs are graphs where nodes fire when inputs are ready, giving implicit parallelism and determinism through single assignment variables.

Check yourself

Answer to earn rating on the learn ladder.

1. When does a node in a dataflow graph fire?

2. What does a single assignment dataflow variable do when read before it is bound?

3. Why are pure single assignment dataflow programs deterministic?