PHP no wait sem_acquire?
问题 Not a specific code question, but more of a general coding question. I'm trying to use a semaphore in a work project to limit the number of users that can access certain processes at a concurrent time. From my understanding the following: $iKey = ftock($sSomeFileLocation,'sOneCharacterString'); //Generate the key if($sem_id = sem_get($iKey)){ //1 user allowed if(sem_acquire($sem_id)){ //Do the limited process here sem_release($sem_id); } } The problem that I see here is that if there is