Re: [PHP4BETA] Databases and multithreading
| From: | Thies C. Arntzen | Date: | Sat, 09 Oct 1999 07:40:10 +0000 |
| Subject: | Re: [PHP4BETA] Databases and multithreading | ||
| References: | 1 | Groups: | php.version4 |
| Request: | Send a blank email to php-version4+get-5421@lists.php.net to get a copy of this message | ||
On Fri, 8 Oct 1999, Andreas Karajannis wrote:
> 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.
nope - as plist is per-thread as well.
> 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...
see above - that should not be a problem...
>
> 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.
s.o.
>
> Non persistent connections should be ok, since they are kept in a per
> thread
> resource list.
same applies to the persistent ones.
>
> Any opinions on this from more "threaded" people?
this should not really be an issue - question is if the db-libs are
thread-save and if they like to be initialized multiple times.
if we want connection-pooling we need to think about something different
which can share data between threads.
regards,
tc
>
> -Andreas
>
> --
> PHP 4 Beta
>
>
Thies C. Arntzen "One Big-Mac, Small Fries and a Coke!"
Digital Collections Phone +49 40 235350 Fax +49 40 23535180
Hammerbrookstr. 93 20097 Hamburg / Germany