Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork33.7k
Description
Feature or enhancement
Proposal:
threading.Thread.join() only waits for the CPython internals to wash its hands of the underlying thread. It doesn't actually wait for the OS thread itself to exit, which in theory happens rapidly as its final internal code completes quickly - but we have no good wait to determine.
Why finally do this now? Now that we're encouraging people to notice and avoid threading existing whenos.fork is called in 3.12, a use case has come up for deterministically knowing when the thread is done at the OS level so that the code can proceed withos.fork.
#110510 could use this in an atfork before fork handler for example.
POSIX has pthread_join, we should be able to expose and use via_thread. Windows presumably has an equivalent concept API.
Has this already been discussed elsewhere?
No response given
Links to previous discussion of this feature:
No response
Linked PRs
Metadata
Metadata
Assignees
Projects
Status