-
-
Notifications
You must be signed in to change notification settings - Fork 30.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
make threading fork-safe #32958
Comments
No description provided. |
See http://www.lambdacs.com/newsgroup/FAQ.html#Q120 I don't use a pthread_atfork handler here - the explicit This patch causes the child to create a new interpreter |
Assigned to me. I'll discuss it with Guido too. So far 2e've gotten 3 reports from people who don't see failures in assorted test cases anymore, and no reports of remaining failures. |
Accepted, and assigned to Jeremy for checkin. |
1 similar comment
Accepted, and assigned to Jeremy for checkin. |
Don't check this in yet! Tim & I had a brainwave. We can share a single mutex for all locks and grab it around a fork, and the lock reinitialization won't be needed. (We think.) |
Now that I've had a chance to drive recklessly, suck down a Coke, and chain-smoke two butts in peace <wink>, I'm certain that the "one mutex" idea will work, and satisfied that the extra contention it may cause is pthread's own damn fault for presuming to kill threads in the child while they're in an unknown state. Full mutex ahead! |
The great idea Tim & I had didn't solve the problem! The problem has a *parent* spinning. We suspect now that it is a LinuxThreads or kernel bug, since there's otherwise no way that what happens in the child can affect the parent. (Charles' fix only adds code that runs in the child.) So I've checked in Charles' patch and leave the thread code alone. Do remember that a long chain of forks will leak a bit -- I see no way around that. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: