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

gevent monkey patching will make neuroglancer not working #536

Open
xiuliren opened this issue Apr 5, 2022 · 1 comment
Open

gevent monkey patching will make neuroglancer not working #536

xiuliren opened this issue Apr 5, 2022 · 1 comment
Labels
redesign It may be flawed, but the code was working as designed.

Comments

@xiuliren
Copy link
Member

xiuliren commented Apr 5, 2022

when I turned on the gevent monkey patching, neuroglancer will be blocked and can not be accessed in the browser. I only see black screen. I have turned off the monkey patching, it works but might be slower. I am fine with it now. If you have some better options, it would be better.

@william-silversmith
Copy link
Contributor

I suspect this is not going to be easily solvable, the monkey patching is pretty crude and causes other issues sometimes. A better solution (at the expense of code maintenance cost) would be to rewrite the functions to be async and then use a runner like asyncio or trio instead. This should be possible now that older versions of python without async support are retired. However, it will take some work. gevent was a nice way to gain the benefits of async without the maintenance cost, but I suppose eventually the cost borne by users will exceed the cost borne by maintainers and favor implementing it.

Green threads aren't always better than regular threads. I noticed in early 2019 that they are most important to have when running on a virtualized system such as a GCP server. Ran found that using "taskset" on linux with a single-core threaded program had a similar performance benefit. The main thing seems to be on these systems to keep the process pinned to a single core for a reasonably long time.

@william-silversmith william-silversmith added the redesign It may be flawed, but the code was working as designed. label Apr 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
redesign It may be flawed, but the code was working as designed.
Projects
None yet
Development

No branches or pull requests

2 participants