Job system for multithreading #11

Open
opened 2026-09-25 19:01:54 -07:00 by burkkyy · 0 comments
Owner

Add a job system to distribute work across worker threads.

Structure

  • Core scheduler lives in its own CMake target in this repo (e.g. engine/jobs/ or libs/sophia_jobs/), built as a STATIC library with no dependencies beyond the standard library, so it can be extracted later if needed.
  • sophia_engine links against it.
  • Engine-specific integration (per-thread Vulkan command pools, frame-scoped job groups, profiling/debug-label hooks) is layered on the engine side, not in the core.

Core scope

  • Worker thread pool (one per hardware thread, minus main)
  • Job submission + wait via counters, e.g. jobs::submit() / jobs::wait(counter)
  • Work stealing between worker queues
  • Unit tests for the core target in isolation

Naming

Use "job" terminology (sophia::jobs, Job, JobSystem) rather than "task", to match game-engine convention and avoid confusion with coroutine task<T> types.

Follow-ups (separate issues)

  • Parallel command buffer recording in the render graph
  • Async asset loading
Add a job system to distribute work across worker threads. ## Structure - Core scheduler lives in its own CMake target in this repo (e.g. `engine/jobs/` or `libs/sophia_jobs/`), built as a `STATIC` library with **no dependencies beyond the standard library**, so it can be extracted later if needed. - `sophia_engine` links against it. - Engine-specific integration (per-thread Vulkan command pools, frame-scoped job groups, profiling/debug-label hooks) is layered on the engine side, not in the core. ## Core scope - Worker thread pool (one per hardware thread, minus main) - Job submission + wait via counters, e.g. `jobs::submit()` / `jobs::wait(counter)` - Work stealing between worker queues - Unit tests for the core target in isolation ## Naming Use "job" terminology (`sophia::jobs`, `Job`, `JobSystem`) rather than "task", to match game-engine convention and avoid confusion with coroutine `task<T>` types. ## Follow-ups (separate issues) - Parallel command buffer recording in the render graph - Async asset loading
burkkyy added the enhancement label 2026-09-25 19:01:54 -07:00
burkkyy added this to the sophia project 2026-09-25 19:02:08 -07:00
burkkyy moved this to Todo in sophia on 2026-09-25 20:42:49 -07:00
burkkyy moved this to Blocked / Discussion in sophia on 2026-09-25 20:44:06 -07:00
Sign in to join this conversation.