Skip to content

Async And Pooling #202

Answered by pacman82
genusistimelord asked this question in Q&A
Discussion options

You must be logged in to vote

I would place this behind a Mutex, but I was wondering if that is necessary

Yes this is necessary. It actually depends on the capabilities of the driver and runtime configuration wether this is safe at all. Yet independent even of that it is not possible to assure the right diagnostics and up at the right thread without an encapsulating mutex.

Since I notice the Connection never needs to be mutable

mut is a misleading keyword. It actually means exclusive. There is plenty of mutation in the connection, but it must be able to be shared by several statements. The safeness of this in a multithreaded scenario depends on the odbc driver correctly protecting its internal state with a mutex. …

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by genusistimelord
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants