Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> About OCI thread safety

About OCI thread safety

From: Herode <cbrun_at_geomapgis.com>
Date: 26 Apr 2006 03:33:24 -0700
Message-ID: <1146047604.815361.21580@i40g2000cwc.googlegroups.com>


Gentlemen,
this is the official page about thtead safety : http://oraclesvca2.oracle.com/docs/cd/B10501_01/appdev.920/a96584/oci09adv.htm#456379

I don't understant how it works.

Oracle says :
"Then the application must tell the OCI layer that the application is
running in multithreaded mode, by specifying OCI_THREADED for the mode parameter of the opening call to OCIEnvCreate()."

And some lines below :
"If an application running in OCI_THREADED mode maintains one or more
environment handles, each of which has multiple connections, it also has the following options:
[...]
Pass a value of OCI_DEFAULT to OCIEnvCreate(). In this case, the OCI library automatically gets a mutex on every OCI call on the same environment handle."

Then, if OCI_DEFAULT is passed ton OCIEnvCreate(), how can the OCI layer know that the application ruens in multithreaded mode ?????

Moreover, the doc says :
"Advantages of OCI Thread Safety

[....]
Users who do not write multithreaded programs do not pay a performance penalty for using thread-safe OCI calls." And a few lines below :
"If an application is single-threaded, whether or not the platform is
thread-safe, the application should pass a value of OCI_DEFAULT to OCIInitialize() or OCIEnvCreate(). Single-threaded applications which run in OCI_THREADED mode may incur performance hits."

So what ??????

regards,
C. Received on Wed Apr 26 2006 - 05:33:24 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US