Skip to content
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

Fix Keyboard Interrupts Windows #57

Merged
merged 2 commits into from Dec 9, 2022
Merged

Fix Keyboard Interrupts Windows #57

merged 2 commits into from Dec 9, 2022

Conversation

dunkmann00
Copy link
Owner

It seems that even though I had gotten the keyboard interrupts working on macOS, they still didn't want to work on Windows when ran in multi-core mode. This change fixes that problem by switching to starmap_async and then manually looping and sleeping until it is ready. This seems to give the interrupts a chance to be processed on Windows while also not adding a performance penalty.

I also tested this on my Mac and the same was true. I won't bother adding a conditional check to only do it this way on Windows since it seems to not have any negative effects on macOS.

This switches to using starmap_async instead of starmap because on
Windows, starmap blocks the keyboard interrupt signal from getting
handled until it finishes. This is obviously not ideal as there can be
a huge delay from when the interrupt is triggered until it is handled.
By using starmap_async and also looping and sleeping while we wait for
it to complete, the interrupt is handled right away AND there is no
noticeable degradation in performance.
@dunkmann00 dunkmann00 merged commit 7b228e8 into main Dec 9, 2022
@dunkmann00 dunkmann00 deleted the kbinterrupts-windows branch December 9, 2022 14:32
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.

None yet

1 participant