Databases and multithreading
| From: | Andreas Karajannis | Date: | Fri, 08 Oct 1999 19:47:43 +0000 |
| Subject: | Databases and multithreading | ||
| Groups: | php.version4 | ||
| Request: | Send a blank email to php-version4+get-5417@lists.php.net to get a copy of this message | ||
To make the database modules thread safe, I think there are changes
with persistent connection handling required:
Currently only one identical connection per process is allowed -
attempting to pconnect with the same parameters will return the
previously
established connection out of the plist. If I got things right, we end
up
with several threads using the same single connection.
Besides the fact, that this is not what we want (a single db connection)
there will be multiple threads trying to execute quasi simultaneous
queries
on the same connection...
So we need some kind of mutexing for pconnetions: The connection handle
returned from pconnect() mustn't be available for other threads until
explicitly released (via close()) or implicitly released on request
shutdown.
Non persistent connections should be ok, since they are kept in a per
thread
resource list.
Any opinions on this from more "threaded" people?
-Andreas