-
Notifications
You must be signed in to change notification settings - Fork 30
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
Multithreading support #16
Conversation
The async API is not supported -- implement all attributes that signal the lack of support. The driver supports the multi-threading model with connection/statement per thread and will further implement connection pooling
All handles have now their own lock, which is acquired at API entry. (The descriptor handles have it too, but the statement locks are used instead.) The connection handles have an extra lock for serializing access to the libcurl-related members, since multiple statements can be active for one connection.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
I only saw one typo.
For this sort of change any bugs are likely to be in what hasn't been changed rather than what has, so I guess the most important thing before release is to do some stress testing with many threads using the driver simultaneously to smoke out any places where locking should have been added but hasn't. But that can be done later, so I'm happy for this to be merged now.
driver/odbc.c
Outdated
@@ -71,7 +71,7 @@ BOOL WINAPI DllMain( | |||
|
|||
// Perform any necessary cleanup. | |||
case DLL_PROCESS_DETACH: | |||
INFO("process %u dettached.", GetCurrentProcessId()); | |||
INFO("process %u dettaching.", GetCurrentProcessId()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There should only be one 't' in 'detaching'.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, fixed.
s/dettaching/detaching/
This PR adds the necessary mutexes for multi-threaded operation.
There are two types of mutexes being added:
Along this PR the async API is dropped (it never has been actually implemented, but there were a few handle members added for future implementation). This is likely not going to be implemented, most apps going for connection threading and pooling. (Relevant other drivers don't support it either.)