开发者

How to use monitors in PHP?

开发者 https://www.devze.com 2023-02-04 18:55 出处:网络
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

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消