Using semaphores in PHP.
| From: | Tom May | Date: | Mon, 16 Nov 1998 17:38:26 +0000 |
| Subject: | Using semaphores in PHP. | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-2430@lists.php.net to get a copy of this message | ||
We're in this situation where we have to limit the number of database
connections active at any one time. In other apache modules we've
written we use a sempahore for this purpose. I was thinking I would
just hack some semaphores into a local copy of PHP for use with
mod_php3, but then I thought that semaphores might be generally useful
and I should create some PHP wrapper functions for them. But it
appears there would be a problem with the time limit code where a
process could grab a semaphore and be time limited before it could
release the semaphore. Assuming the process doesn't exit() and
instead lives to process another request, this would be bad.
Any input on whether adding semaphore wrappers would be a reasonable
thing to do, and how to deal with the time limit problem (other than
not using a time limit)?
Tom.
--
PHP Development Mailing List http://www.php.net/
To unsubscribe send an empty message to php-dev-unsubscribe@lists.php.net
For help: php-dev-help@lists.php.net