How to开发者_开发百科 use monitors in PHP?
I might be wrong but i thought that the server side model of execution of php is single threaded (aka no more than one thread). In fact i think this is one of reasons of PHP's success. If this is the case i doubt is relevant how do you use synchronization primitives in php.
PHP is single threaded so there is no need for synchronization.
PHP is single threaded, but if you want to have something like mutex between different processes and you use PHP5, you can simply use built-in session locking to achieve this. Just combine session_start and session_commit at correct places.
精彩评论