Skip to content

Conversation

@straight-shoota
Copy link
Member

fork in a multi-threaded process is a very delicate matter. We must avoid cancelling the thread while performing a fork. Cleanup could cause problems while we're setting up the new process.

This would not be necessary if we were using vfork semantics. That's generally the better choice for spawning a new process, as there is no need to copy the entire process memory. vfork is more efficient and we should ideally use that.

However, we're hoping to switch to posix_spawn eventually (#11337), which provides a safe and efficient implementation, and we don't need to deal with the details explicitly.
The is currently blocked on the need to reopen stdio in the housekeeping stage (#16353) but we're expecting to resolve that soon.

@straight-shoota straight-shoota self-assigned this Nov 28, 2025
@straight-shoota straight-shoota added kind:bug A bug in the code. Does not apply to documentation, specs, etc. topic:stdlib:system topic:multithreading labels Nov 28, 2025
@straight-shoota straight-shoota modified the milestone: 1.19.0 Nov 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind:bug A bug in the code. Does not apply to documentation, specs, etc. topic:multithreading topic:stdlib:system

Projects

Status: Review

Development

Successfully merging this pull request may close these issues.

2 participants