日本综合一区二区|亚洲中文天堂综合|日韩欧美自拍一区|男女精品天堂一区|欧美自拍第6页亚洲成人精品一区|亚洲黄色天堂一区二区成人|超碰91偷拍第一页|日韩av夜夜嗨中文字幕|久久蜜综合视频官网|精美人妻一区二区三区

RELATEED CONSULTING
相關(guān)咨詢
選擇下列產(chǎn)品馬上在線溝通
服務(wù)時間:8:30-17:00
你可能遇到了下面的問題
關(guān)閉右側(cè)工具欄

新聞中心

這里有您想知道的互聯(lián)網(wǎng)營銷解決方案
分享一個php處理信號的小例子

sigkill和sinstop 在進行信號處理時,不能被忽略,(處理信號可以有忽略,執(zhí)行默認(rèn) 執(zhí)行用戶指定處理)

php信號小例子


~

執(zhí)行結(jié)果

root@lyh:/home/tbtest# php sigint.php 
^Cjust for sigint
^Cjust for sigint
^Cjust for sigint
just for sigquit
^Cjust for sigint
^Cjust for sigint
^Z
[1]+  Stopped                 php sigint.php
root@lyh:/home/tbtest# bg
[1]+ php sigint.php &
root@lyh:/home/tbtest# fg
php sigint.php
root@lyh:/home/tbtest# cat out.txt 
29秒
root@lyh:/home/tbtest#

關(guān)于捕捉sigquit

上面捕捉到了jsut for sigquit 是因為我另外起了一個終端,

root@lyh:~# ps -aux |grep php                                    
root     16385  0.5  1.9 377720 19468 pts/2    S+   15:09   0:00 php sigint.php
root     16390  0.0  0.0  11744   932 pts/0    S+   15:09   0:00 grep --color=auto php
root@lyh:~# kill -s sigquit 16385

ps:pcntl_signal_dispatch 比ticks效率會更高


分享文章:分享一個php處理信號的小例子
轉(zhuǎn)載來于:http://www.dlmjj.cn/article/cdhhosc.html