PHP中的同步功能 [英] Synchronized functions in PHP

查看:82
本文介绍了PHP中的同步功能的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有一种方法可以使PHP中的功能同步,以确保两个或多个Web用户不能同时执行相同的功能?

Is there a way to make functions in PHP synchronized to make sure that two or more webusers can't execute the same function at the same time?

推荐答案

我认为您可以通过使用

I think you might achieve the same(if available) by using sem_acquire to acquire a semaphore (entering crital section) and sem_release to release the lock.

这篇关于PHP中的同步功能的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆