← Lessons

quiz vs the machine

Platinum1800

Concurrency

Dataflow Graph Execution

Running operations as soon as their inputs are ready, driven by data not by program order.

6 min read · advanced · beat Platinum to climb

Programs as graphs

In the dataflow model a computation is a directed graph. Each node is an operation, and each edge carries data from a producer node to a consumer node. There is no central program counter; a node simply fires when its inputs arrive.

Readiness drives execution

A node becomes ready when all of its input edges hold a value. The scheduler runs any ready node, which then places results on its output edges, possibly making downstream nodes ready. Independent ready nodes run in parallel automatically, because the graph encodes exactly which operations depend on which.

  • Dependencies are explicit as edges.
  • Parallelism is whatever the graph leaves unconstrained.
  • Order emerges from data readiness, not source line order.

Static versus dynamic graphs

A static graph is fixed before execution, easy to optimize and schedule ahead of time. A dynamic graph is built as the program runs, more flexible but harder to plan. Many compute frameworks build a dataflow graph of operations and then schedule it across cores or devices.

Key idea

Dataflow execution represents a program as a graph where nodes fire as soon as their inputs are ready, so dependencies are explicit edges and any independent operations run in parallel without manual scheduling.

Check yourself

Answer to earn rating on the learn ladder.

1. When does a dataflow node fire?

2. Where does parallelism come from in a dataflow graph?

3. What advantage does a static dataflow graph have?