How to use monitors in PHP?

How to use monitors in PHP?

0
source share
3 answers

Maybe I'm wrong, but I thought that the php execution model on the server side is single-threaded (aka no more than one thread). In fact, I think this is one of the reasons for the success of PHP. If so, I doubt how much you use synchronization primitives in php.

+3
source

PHP is single-threaded, so there is no need for synchronization.

+1
source

PHP is single-threaded, but if you want to have something like mutex between different processes and use PHP5, you can simply use the built-in session lock to achieve this. Just connect session_start and session_commit in the right places.

0
source

All Articles