|
Re: Forking PHP to death!!: msg#00281php.tcphp
Semaphores aren't particularly slow unless you have thousands of threads. The problem with sem_acquire() in PHP is that it is missing the sem_op parameter normally found in semop() - sem_op for sem_acquire() in PHP is always set to one, which means that it is only useful for a) limiting access to a critical resource read-only to a specific number of clients; or b) full locking of the critical resource to one client at a time, read or write. You can't have both. For a normal semop() call you can adjust the sem_op parameter so that you can have multiple readers / one writer of the critical resource in question - the writer will block out the rest of the readers while it's writing, but the writer can also be made to wait until after all the readers are done (PHP can't do the latter). I don't know if whoever wrote the sem_* PHP bindings didn't understand the semop(2) man page or if it's a limitation of Win32 semaphores or whatever, but the sem_* functions aren't terribly useful in their current state. -Bob On Jun 29, 2005, at 3:24 PM, Richard Thomas wrote: Anyone on the lists play with pcntl_fork much? --------------------------------------------------------------------- To unsubscribe, e-mail: talk-unsubscribe-4zcLI8jJc/rYtjvyW6yDsg@xxxxxxxxxxxxxxxx Please read and follow the list guidelines: http://www.tcphp.org/mailing_list/guidelines The tcphp.org mailing list is sponsored by pajunas interactive, inc. |
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | Forking PHP to death!!: 00281, Richard Thomas |
|---|---|
| Next by Date: | Re: Forking PHP to death!!: 00281, Richard Thomas |
| Previous by Thread: | Forking PHP to death!!i: 00281, Richard Thomas |
| Next by Thread: | Re: Forking PHP to death!!: 00281, Richard Thomas |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |