Quick fix (was: Re: [PHP-DEV] OCI8 Thread safety)

From: Date: Mon, 09 Apr 2001 00:32:54 +0000
Subject: Quick fix (was: Re: [PHP-DEV] OCI8 Thread safety)
References: 1 2  Groups: php.dev 
Request: Send a blank email to php-dev+get-51159@lists.php.net to get a copy of this message
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"" <thies@thieso.net> wrote in message news:20010408000128.A1572@vaio.thieso.net... > 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: php-dev-unsubscribe@lists.php.net > For additional commands, e-mail: php-dev-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net >

« previous php.dev (#51159) next »