Skip to content

Increasing responsiveness#12

Open
aeph6Ee0 wants to merge 2 commits into
okraits:masterfrom
aeph6Ee0:master
Open

Increasing responsiveness#12
aeph6Ee0 wants to merge 2 commits into
okraits:masterfrom
aeph6Ee0:master

Conversation

@aeph6Ee0

Copy link
Copy Markdown

This PR increases the responsiveness in two ways:

Skipping and Quitting

Currently if 'n' or 'q' command is submitted, it takes up to 30 seconds for the program to respond.

This issue is resolved by introducing a signaling mechanism (queue) to wake up the thread on those events, such that the thread can immediately respond to those events.

Quitting via Ctrl-c

Currently the program hangs when trying to kill it with Ctrl-c.

This issue is resolved by handling the KeyboardInterrupt exception and cleanly shutting down the program immediately.

@okraits

okraits commented Apr 25, 2018

Copy link
Copy Markdown
Owner

Thank you for the pull request. I'm pretty busy at the moment but I will take a look at it when I have the time.

@okraits

okraits commented Jul 20, 2018

Copy link
Copy Markdown
Owner

Regarding your first commit: I'm not so happy with using queues for that. I would rather use condition objects or event objects for this.

What do you think about this?

@aeph6Ee0

aeph6Ee0 commented Jul 21, 2018

Copy link
Copy Markdown
Author

I agree with you that for the current implementation, a condition or event object would be sufficient.
However, I already thought about further code improvements.
Currently the command variable is (unnecessarily) global, which is in general undesired. So I planned to send the command string via the queue to the thread directly in order to avoid the global scope. Queues are predestined for sending a variety of different events in a multithreaded environment.

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