I'm still a neophite at thread safety/PHP internals, but I found a quick fix
to the OCI8 and PHP in threaded envrionment.

Changing OCI_THREADED to OCI_DEFAULT in the OCIInitialize function is the
quick fix I discovered.  It works because the OCI8 exention is designed for
seperate address space for all oci calls.

You can't call OCIInitialize or OCIEnvInit mutiple times in a process.  They
are designed to be called once through the life of a process.  OCI in a
threaded environment the threads share the parent's OCIEnvironment.  The OCI
module currently doesn't take this into consideration and calls OCIEnvInit
when it grabs a copy of the OCI_globals.  Works fine if they're not sharing
the Parent environment, traditional Unix style processes.

Not using OCI_THREADED in OCIInitialize, OCI threads act like seperate
processes.

OCI8 has the ability to take full advantage of a threaded environment.  I've
studied the calls etc. and there is a lot of resource sharing that can be
implemented with OCI in threaded environment.  Implementing OCI_SHARED can
provide supererior perfomance increases on threaded servers.  It's and ideal
switch to throw into the mix, but a lot of rewiring needs to be done on the
OCI8 module for this to work as advertised.

Thies, I'd love to work with you on this, if you're interested...  I need
some help understanding how the existing code operates.  I have a feel for
it, but would like some assumption verification.  ;-)

joebrown
podiatryfl.com

""Thies C. Arntzen"" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> On Fri, Apr 06, 2001 at 10:50:49PM -0400, Joe Brown wrote:
> > It appears to me that the oci8 module does not behave well on win32 - a
> > threaded environment.  I've begun to study the code, and believe I can
make
> > it mind the rules.
>
>     what is not thread-safe in your opinion? i don't use windows
>     or any other threded server so i can't really tell
> >
> > Thread safe programming is new to me.  (hehe were have you heard that
b4?-)
> >
> > Is anyone else working on the OCI8 extension?
>
>     i am
>
>     tc
>
> --
> PHP Development Mailing List <http://www.php.net/>
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>



-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to