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

uv_eio_init calls eio_init multiple times #15

Open
paddybyers opened this issue Nov 4, 2011 · 0 comments
Open

uv_eio_init calls eio_init multiple times #15

paddybyers opened this issue Nov 4, 2011 · 0 comments

Comments

@paddybyers
Copy link
Owner

uv-eio.c calls eio_init once for each loop.

However, if more than one loop is initialised in any given process, eio_init will be called more than once, which is forbidden.

Normally this is not a problem, but it becomes a problem in applications that wish to have multiple loops in a single process. This behaviour is now sought for the Android port.

One solution - which assumes that pthreads are unconditionally available - is here.

This is perhaps OK, or perhaps the dependency on pthread_once needs to be abstracted to support those unix platforms that don't support this.

On the other hand, the principal thread abstraction is in eio/xthread.h, and eio already has multiple mutexes, so I would have thought that this could be implemented more naturally in eio itself, so eio_init guards itself against multiple calls in the same process. Suggestions welcomed.

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

No branches or pull requests

1 participant