Skip to content

Document subprocess worker-thread context inheritance - #3505

Closed
roli-lpci wants to merge 1 commit into
python-trio:mainfrom
roli-lpci:docs/run-process-worker-thread-context
Closed

Document subprocess worker-thread context inheritance#3505
roli-lpci wants to merge 1 commit into
python-trio:mainfrom
roli-lpci:docs/run-process-worker-thread-context

Conversation

@roli-lpci

Copy link
Copy Markdown

Summary

  • document that trio.run_process and trio.lowlevel.open_process call
    subprocess.Popen from a worker thread
  • explain that applicable per-thread operating-system state is therefore
    inherited from the worker thread, with Linux namespaces and CPU affinity as
    examples
  • add the corresponding documentation release note

This addresses the documentation request in #3360. It leaves the API and
spawning behavior unchanged; #3462's synchronous-spawn option was closed because
blocking the Trio event loop is unacceptable.

Validation

  • a focused runtime probe wrapped the real subprocess.Popen, launched a child,
    and confirmed that Popen ran on a different OS thread from Trio's event loop
  • sphinx-build -W --keep-going -b html docs/source ...
  • towncrier build --draft
  • file-scoped pre-commit checks for the two changed files

@A5rocks

A5rocks commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

I'm not willing to waste my time reviewing this given how many open PRs you have + LLM generated PR description. I also think it's not exactly right because I don't think docs really address the issue, or at least I'm not yet convinced there isn't a solution.

@A5rocks A5rocks closed this Sep 8, 2026
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.

2 participants