-
Notifications
You must be signed in to change notification settings - Fork 32
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
Ressource sharing / Asynchronous lock #18
Comments
Heya @amirouche... I'm not sure this belongs on the bug tracker, so I'm going to close it (maybe in the future guile-user is a better place to discuss this?), but it it's a good question. The right route is to never use locks directly. Instead, you have two patterns:
Hope that helps... does that make sense to you? |
That's what I had in mind, but I did not come up with the code yet. |
btw, everybody on github use issues to ask questions. |
That said, I will ask my questions in the mailling list in the future. I feared that my question would go without notice on the ML ... |
Yeah I understand... it also sometimes makes sense to ask because maybe it wasn't a feature that Fibers provided. Maybe what we need is a "common patterns" page so that people can see how to do these kinds of things? |
Yes. |
In my search engine, the database works with contexts. I must limit the number of context since the underlying database can not open as much context as there can be concurrent fibers.
Right now the revelant code is the following:
As you can see right now, the number of context is unbound. So this will lead to a crash if there is too many concurrent fibers.
What I would like is that a fiber request a context and suspend until one is available if there is none available and the limit is reached.
How can I achieve that?
The text was updated successfully, but these errors were encountered: