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
Why not drop the _active list? #43107
Comments
I am using a modified version of subprocess.py, where I have removed the _active list and all I have tested it (under Windows 2000) and there were So what is the reason for managing the _active list |
Logged In: YES I agree. The use of _active makes subprocess.py thread-UNsafe. See also: Bug bpo-1199282 In order to have a thread-safe subprocess.py, I commented |
Logged In: YES The purpose of the _active list is to wait(2) for open |
Logged In: YES If you always called wait() the _active list isn't If you need thread safely, you can handle the locking |
Logged In: YES what happens if you are doing a _cleanup (iterating over a thread 1 starts a _cleanup: makes a copy of _active[:] and thread 1 encounters a finished process and removes it from so the action of cleaning up should maybe be serialized everyone who needs this can of course patch the |
Logged In: YES the same problem probably exists in popen2.py |
Logged In: YES also bpo-1214859 is interesting, has a patch |
Logged In: YES attila-cheops, please read the 2.5 version of popen2. popen2 now only adds processes to _active in __del__, not in Multiple threads simultaneously isn't a problem, since it is The same strategy should be applied to subprocess. |
Logged In: YES the implementation in 2.5 of popen2 seems good |
Logged In: YES see patch bpo-1467770 |
Logged In: YES This was fixed with said patch. |
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: