Ale*_*lex 24 php semaphore apc
我有以下代码,信号量不会按预期锁定它.
(我知道apc_inc.这不是我想要的.)
$semkey = sem_get(123);
sem_acquire($semkey);
$count = apc_fetch('count111');
if(!$count) $count = 0;
$count++;
apc_store('count111', $count);
sem_release($semkey);
Run Code Online (Sandbox Code Playgroud)
其次是
ab -n 4000 -c 200 http://localhost/test.php
0请求失败.
但之后apc_fetch('count111')
只显示了~1200次点击
nginx on ubuntu 12.04(64bit),php 5.3.16~dotdeb,php-fpm