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

Avoid 100% CPU on asyncio.sleep(0) #11

Merged
merged 2 commits into from
Jun 24, 2019
Merged

Conversation

higucheese
Copy link
Contributor

When I used vpython on jupyter notebook, I faced a problem that a vpython kernel running on a remote server kept using 100% CPU. After surveying, I found the CPU spin was caused by asyncio.sleep(0) function. This issue ( python/asyncio#398 ) describes the problem in detail.

To solve the problem, simply waiting longer than zero works well; the CPU usage changes from 100% to 1%. Of course, this change does not harm the performance of vpython in my sense.

@mwcraig mwcraig added the enhancement New feature or request label Jun 22, 2019
@mwcraig
Copy link
Contributor

mwcraig commented Jun 22, 2019

@higucheese -- thanks so much for the pull request! Just one extra thing to do before we merge: please add yourself to the list of contributors here https://github.com/vpython/vpython-jupyter/blob/master/CONTRIBUTORS.md

If you would like me to take care of that for you just let me know.

@higucheese
Copy link
Contributor Author

@mwcraig -- thank you for replying to this PR.
There is no problem with adding myself to the list. But how should I do that? Would you be able to add '@higucheese' to the list?

@mwcraig
Copy link
Contributor

mwcraig commented Jun 24, 2019

@higucheese -- yep, I can add it. What would you like us to list as your name (if anything) in addition to your github username?

@higucheese
Copy link
Contributor Author

Would you add 'Tomokazu Higuchi (@higucheese)' to the list like other additional contributors? Thank you!

@mwcraig
Copy link
Contributor

mwcraig commented Jun 24, 2019

Thanks again @higucheese, merging!

@mwcraig mwcraig merged commit a480610 into vpython:master Jun 24, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants