Remove the legacy worker API and its executor - #75
Merged
Conversation
Contexts are the only execution path; the per-worker NIFs, the single executor thread they ran on, the deprecated async worker NIFs, the unused worker pool, the cancel aliases and the unreachable inline executor branches of the context NIFs are gone (about 3,000 lines). This removes public NIF functions, so the open release becomes 5.0.0. memory_stats and gc run under the GIL on the calling scheduler. The generator example uses py:stream.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Removes the code that no context created today can reach, so what is left is what runs.
Before contexts, Python ran on a single executor thread driven by per-worker NIFs (
worker_new,worker_call,resume_callback, ...). Contexts replaced that, but the old path stayed: the executor was still started at init,erlang.callstill checked for a worker handler, the context NIFs kept an inline "legacy mode" branch, and a second worker pool with no caller was compiled in. A reader tracing a call had four candidate paths and no way to tell which one was live.This removes the worker API and its executor, the async worker NIFs that only returned
deprecated, the worker pool, thecancel_reader/writeraliases and the inline branches, with their Erlang stubs and types.py:memory_stats/0andpy:gc/0,1, which ran on the executor, now take the GIL on the calling scheduler. The generator example moves topy:stream. The architecture and code map pages no longer list legacy paths.About 3,000 lines fewer, no behaviour change for contexts. The removed NIFs were public, so the open release is 5.0.0. Full suite green on macOS and FreeBSD apart from two pre-existing local failures that reproduce on
main.