Should I Put Critical Section While Getting Connection from OCCI Environment

Posted by sahs on Stack Overflow See other posts from Stack Overflow or by sahs
Published on 2010-05-07T11:24:58Z Indexed on 2010/05/07 11:28 UTC
Read the original article Hit count: 174

Filed under:
|
|

Hello, I'm writing a multi-threaded application. My worker threads get connection from an environment object as follows:.

//EnterCriticalSection(&cs);
conn = env->createConnection(username, password, connStr);
//LeaveCriticalSection(&cs);

For concurrency, should the connection be created in a critical section or not? Does the env need it? And why?

Thanks.

© Stack Overflow or respective owner

Related posts about c++

Related posts about concurrency