php两分钟死循环内加usleep(500000);后为什么会卡死?
我做一个两分钟的死循环(超过两分钟会跳出),在循环内加usleep(500000);后会卡死,慢日志也会记录;去掉之后就没有事,想知道为什么?
这是慢日志
[0x00007f9cd9296868] usleep() /aa/www/Application/Home/Controller/AaController.class.php:174
[0x00007ffd08484540] checkse() unknown:0
[0x00007f9cd9295960] invoke() /aa/www/ThinkPHP/Library/Think/App.class.php:172
[0x00007f9cd9294e18] invokeAction() /aa/www/ThinkPHP/Library/Think/App.class.php:109
[0x00007f9cd9294c40] exec() /aa/www/ThinkPHP/Library/Think/App.class.php:203
[0x00007f9cd9293438] run() /aa/www/ThinkPHP/Library/Think/Think.class.php:120
[0x00007f9cd9291d50] start() /aa/www/ThinkPHP/ThinkPHP.php:97
[0x00007f9cd9291c00] +++ dump failed
这是代码
$while = true;
while ($while) {
//这里面做了时间判断 超过两分钟$while=false;
// usleep(500000);
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论