gpt4 book ai didi

unixodbc - 在多线程并发设置中使用unixODBC

转载 作者:行者123 更新时间:2023-12-04 13:17:47 24 4
gpt4 key购买 nike

我要问和回答这个问题,因为这使我花了很长时间才弄清楚,我希望答案从这里开始。

问题:一个长时间运行的unixODBC查询会阻止同一应用程序中的所有其他查询。

问题是:如何阻止这种情况的发生。

最佳答案

答案以__handles.c中的剪切粘贴评论的形式出现-我知道,为什么每个人都没有想到从那里开始寻找文档,对吗?

/*
* use just one mutex for all the lists, this avoids any issues
* with deadlocks, the performance issue should be minimal, if it
* turns out to be a problem, we can readdress this
*
* We also have a mutex to protect the connection pooling code
*
* If compiled with thread support the DM allows four different
* thread strategies
*
* Level 0 - Only the DM internal structures are protected
* the driver is assumed to take care of it's self
*
* Level 1 - The driver is protected down to the statement level
* each statement will be protected, and the same for the connect
* level for connect functions, note that descriptors are considered
* equal to statements when it comes to thread protection.
*
* Level 2 - The driver is protected at the connection level. only
* one thread can be in a particular driver at one time
*
* Level 3 - The driver is protected at the env level, only one thing
* at a time.
*
* By default the driver open connections with a lock level of 3,
* this can be changed by adding the line
*
* Threading = N
*
* to the driver entry in odbcinst.ini, where N is the locking level
* (0-3)
*
*/

关于unixodbc - 在多线程并发设置中使用unixODBC,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4207458/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com