function - How to stop two visitors hitting a PHP script at the same second -


hi have had issue 2 visitors have hit php function within second of each other. function sends them 1 time use code pool of codes , sent both people same code.

what methods can use in script check if else being processed , either delay or wait other person finish?

i know seems general question hard explain mean! can help!

what methods can use in script check if else being processed , either delay or wait other person finish?

that call "mutex", short mutually exclusive.

notice without knowing how php run on server, it's hard know whether php's built-in mutex routines work. php bad language when comes multithreading.


Comments

Popular posts from this blog

php - Invalid Cofiguration - yii\base\InvalidConfigException - Yii2 -

How to show in django cms breadcrumbs full path? -

ruby on rails - npm error: tunneling socket could not be established, cause=connect ETIMEDOUT -