> For the complete documentation index, see [llms.txt](https://wise-shepherd-games.gitbook.io/theia-ecs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://wise-shepherd-games.gitbook.io/theia-ecs/execution.md).

# Execution

How world data gets read and processed each tick

Execution in Theia is how world data gets **read and processed** each tick. There are three primitives, each with a distinct responsibility:

* **Queries:** the iteration primitive. A query walks **entities matching a component composition** and delivers their component data by reference, **directly from archetype storage**.
* **Systems:** declare the execution order explicitly. Systems are composed into **a fixed, deterministic sequence** at construction time: sequential by default, parallel opt-in via `ParallelSystems`.
* **Jobs:** the **parallel execution unit**. Used internally by parallel query iteration and by `ParallelSystems` to dispatch work across worker threads.

**System** declares **what runs and when**.&#x20;

**Query** is what actually **reads and mutates data**.&#x20;

**Jobs** is how that **work gets distributed across threads** when parallelism is needed.

The three following sub pages cover each primitive in depth:

* [Queries](/theia-ecs/execution/queries.md): `SettlerQuery`, `NomadQuery`, iteration shapes, callback contracts;
* [Systems](/theia-ecs/execution/systems.md): `System`, `System<QueryT1>`, `System<TSharedData, QueryT1, QueryT2>`, `ParallelSystems`, `SystemsRoot`;
* [Jobs](/theia-ecs/execution/jobs.md): `Job`, `JobPool`, `JobScheduler`.
