Skip to content

refactor: centralize async runtime around shared loop and pools#61

Open
hrodmn wants to merge 7 commits into
mainfrom
refactor/concurrency-model
Open

refactor: centralize async runtime around shared loop and pools#61
hrodmn wants to merge 7 commits into
mainfrom
refactor/concurrency-model

Conversation

@hrodmn
Copy link
Copy Markdown
Collaborator

@hrodmn hrodmn commented May 17, 2026

The concurrency model was somewhat messy (as noted in #31) so I wanted to make things simpler. Here are a few refactor-ish changes that make lazycogs concurrency easier to reason about:

  • DuckDB chunk queries now yield the event loop by running through one bounded internal helper and explicit executor.
  • The sync bridge now submits to one shared persistent background loop instead of per-thread loops, and first-use loop startup waits until that loop is actually running.
  • Reprojection now uses one explicit bounded pool, and the store cache no longer depends on thread-local state.

The single reprojection pool affected the benchmark conditions for the single-worker case so we see a regression in that benchmark test.

I also removed the not-very-useful read_chunk synchronous shim around read_chunk_async.

@hrodmn hrodmn changed the title Refactor/concurrency model refactor: centralize async runtime around shared loop and pools May 17, 2026
@hrodmn hrodmn force-pushed the refactor/concurrency-model branch from cbef616 to 1faee9d Compare May 17, 2026 10:41
@hrodmn hrodmn force-pushed the refactor/concurrency-model branch from 835441f to 7527567 Compare May 18, 2026 20:28
@hrodmn hrodmn marked this pull request as ready for review May 19, 2026 01:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant