Skip to content

Worker threads: Zphp\Pool, Future, and Task - #81

Merged
nvms merged 2 commits into
mainfrom
worker-threads
Sep 14, 2026
Merged

nvms merged 2 commits into
mainfrom
worker-threads

Conversation

@nvms

@nvms nvms commented Sep 14, 2026

Copy link
Copy Markdown
Owner

Phase 1 of #68.

A pool of OS threads, each running an isolated VM bootstrapped by a script, executes named callables with transferable arguments and hands results and exceptions back through futures. Values cross as serialized bytes. Closures, generators, and handle-backed objects are refused at submit time with the offending path.

Included: cooperative cancellation, a bounded queue with blocking and non-blocking submit, completion order through collect, a readiness stream usable from stream_select, and shutdown with an optional timeout.

Tests: tests/workers/run (make workers) covers behaviour, saturation, shutdown under load, bootstrap failure, repeated pools, and a scaling benchmark. The memory-soak job runs a retention probe on the release build.

a pool of os threads, each running an isolated vm bootstrapped by a
script, executes named callables with transferable arguments and hands
results and exceptions back through futures. values cross as serialized
bytes; closures, generators, and handle-backed objects are refused at
submit time with the offending path. cooperative cancellation, a bounded
queue with blocking and non-blocking submit, completion order through
collect and a readiness stream for stream_select, shutdown with an
optional timeout. tests/workers/run covers behaviour, saturation,
shutdown under load, bootstrap failure, repeated pools, and a scaling
benchmark; the memory-soak job runs a retention probe on the release
build
@nvms
nvms merged commit c054083 into main Sep 14, 2026
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant