-
Notifications
You must be signed in to change notification settings - Fork 63
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
Concurrent database calls #80
Comments
Maybe worthwhile to see if |
Hey @amitmurthy, do separate threads have the ability to do parallel IO? I'm wondering about the case where I want to do concurrent queries and stream the results to disk. |
As long as we are not using the libuv API in the separate thread, there should be no issue. In this case since I/O is happening from the ODBC library call it should be perfectly OK. We will have to be careful of not using ODBC handles across threads concurrently though. |
This is basically the use-case for |
I'm just worried about cases where you're streaming results to disk. You think you're doing "concurrent" database calls, which technically you are, but once you start writing the results to disk, things get locked up. |
Ok, looked into this (finally!). I couldn't find a way that made thing work reliably. |
Does ODBC have a non-blocking API? |
It looks like the spec does allow for async operations, so here's a PR that gives it a whirl: #269 |
It's a little unsatisfying because it depends on if the individual drivers actually implement the async abilities; as opposed to a |
Though on the other hand, in our new 1.3+ world, it's pretty easy for users to do |
That's not guaranteed to run on a separate thread, so it may still block the entire application. Perhaps this is fine until we have a more general way to run potentially blocking calls on a separate thread. This is certainly not the only package that wants such a capability. Many GUI toolkits want the same ability as well. |
https://github.com/wankdanker/node-odbc the ODBC interface for Node, uses separate threads for database calls in parallel. Since Julia too uses libuv, it makes sense to incorporate, or at least try out, the same strategy for parallel DB calls..
Creating an issue here, in case someone feels like taking it up.
The text was updated successfully, but these errors were encountered: