Release GIL when creating or starting a service#2062
Merged
mhammond merged 2 commits intomhammond:mainfrom Jun 7, 2023
Merged
Conversation
mhammond
requested changes
May 31, 2023
Owner
mhammond
left a comment
There was a problem hiding this comment.
The service changes look fine, but please split the makefile change into a different PR, as that might break other workflows
Owner
|
Maybe add a note to the changelog too? |
Contributor
Author
|
I've added a note to CHANGES.txt and backed out the makefile_pythonwin change. I didn't plan to submit that at the same time I just needed it to make the code build on my machine. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Some service take a while to start so this change releases the GIL so that the python process isn't blocked. It only applies to CreateService and StartService. I guess it could also be applied to ControlService and DeleteService but these are simple calls into the Win32 API (and we've not had a problem with services taking a long time to stop or when being deleted)
It also has a small build change: on some machines (generally developer systems) the default action for a .py file isn't to run it, but to edit it. If the default action has been changed then the build breaks so my change just runs the h2py.py script using python.exe explicitly. This seems to be the only place where .py files are run without specifying the interpreter