Just to clarify what is meant by "process" above:
On the Apache webserver, many PHP requests will be executed within the same process space because it is multithreaded. However, any semaphores got and acquired by a script and not released and removed will still be automatically cleaned up by the PHP interpreter each time the script terminates.
Remove any trash before emailing!
sem_acquire
(PHP 4, PHP 5)
sem_acquire — セマフォを得る
説明
bool sem_acquire ( resource $sem_identifier )sem_acquire() は、(必要な場合) セマフォが確保できるまでブロックします。 既に確保されているセマフォを得ようとするプロセスは、 セマフォの獲得により max_aquire 値を超える場合、 永久にブロックされます。 sem_identifier はセマフォのリソースで、 sem_get() によって得られます。
成功した場合に TRUE を、失敗した場合に FALSE を返します。
リクエスト処理の後、プロセスにより獲得された全てのセマフォのうち、 明示的に開放されていないものが自動的に開放され、警告が表示されます。
sem_get() および sem_release() も参照ください。
sem_acquire
gladd at trash dot eris dot qinetiq dot com
14-Apr-2004 06:02
14-Apr-2004 06:02
24-Jun-2003 08:58
there is no way to use IPC_NOWAIT flag.