Skip to content

Release GIL when creating or starting a service#2062

Merged
mhammond merged 2 commits intomhammond:mainfrom
adamkbmc:main
Jun 7, 2023
Merged

Release GIL when creating or starting a service#2062
mhammond merged 2 commits intomhammond:mainfrom
adamkbmc:main

Conversation

@adamkbmc
Copy link
Copy Markdown
Contributor

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

Copy link
Copy Markdown
Owner

@mhammond mhammond left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The service changes look fine, but please split the makefile change into a different PR, as that might break other workflows

@mhammond
Copy link
Copy Markdown
Owner

Maybe add a note to the changelog too?

@adamkbmc
Copy link
Copy Markdown
Contributor Author

adamkbmc commented Jun 5, 2023

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.

Copy link
Copy Markdown
Owner

@mhammond mhammond left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@mhammond mhammond merged commit ba25e75 into mhammond:main Jun 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants