当前位置:首页>Linux>进程都退出了,为什么还要“等”?Linux进程等待机制详解

进程都退出了,为什么还要“等”?Linux进程等待机制详解

  • 2026-08-25 11:07:57
进程都退出了,为什么还要“等”?Linux进程等待机制详解

文章目录

  • 概要&序論
  • 一、 进程等待的必要性与核心概念
    • 1.1 为什么需要进程等待?
    • 1.2 进程等待的解决方案
  • 二、 进程等待的核心系统调用
    • 2.1 函数原型与基础引入
    • 2.2 wait 函数详解
    • 2.3 waitpid 函数详解
      • 2.3.1 参数 pid 的取值与含义
      • 2.3.2 参数 options 的控制
    • 2.4详细讲解options参数
      • 2.4.1怎么记忆这个选项——题外话
      • 2.4.2 阻塞等待与非阻塞等待
      • 2.4.3非阻塞等待的代码
  • 三、 深入理解 status 状态参数
    • 3.0进程的退出信息到底是怎么被父进程获取的
    • 3.1 status 的位图结构
      • 3.1.1 正常终止(Normal Termination)
      • 3.1.2 被信号所杀(Signaled Termination)
    • 3.2 通过 status 获取退出信息与信号
      • 3.2.1 传统方法:位运算提取
      • 3.2.2 系统标准方法:宏函数提取

概要&序論

  Hello大家好,我是此方。本文深刻探讨 Linux 进程等待机制。

  • 阐述解决僵尸进程与回收资源的必要性;
  • 详解 wait 与 waitpid 系统调用的参数及阻塞行为;
  • 解构 status 状态参数的 16 位位图布局与宏函数解析;
  • 揭示内核 task_struct 的交互原理;
  • 对比阻塞与非阻塞轮询结合 std::function 的应用。

好的,我们直接开始。

一、 进程等待的必要性与核心概念

1.1 为什么需要进程等待?

  • 之前讲过,子进程退出,父进程如果不管不顾,就可能造成“僵尸进程”的问题,进而造成内存泄漏。
  • 另外,进程一旦变成僵尸状态,那就刀枪不入,“杀人不眨眼”的 kill -9 也无能为力,因为谁也没有办法杀死一个已经死去的进程。
  • 最后,父进程派给子进程的任务完成的如何,我们需要知道。如,子进程运行完成,结果对还是不对,或者是否正常退出。

1.2 进程等待的解决方案

  基于上述必要性,系统提供了特定的系统调用来 供父进程回收子进程,获取子进程退出信息。 其中最核心的两个函数是 wait 和 waitpid 在具体执行时,父进程通过进程等待可以达成两个主要目的:

  • 回收子进程资源(最关键的硬性需求)
  • 获取子进程退出信息(可选的控制需求)

二、 进程等待的核心系统调用

2.1 函数原型与基础引入

  要使用进程等待功能,必须引入以下两个系统调用头文件:

#include<sys/types.h>#include<sys/wait.h>

系统提供了两个主要的等待接口:

pid_twait(int *status);pid_twaitpid(pid_t pid, int *status, int options);

2.2 wait 函数详解

wait 函数是较简易的等待接口,它的参数和行为非常直接:

  • 参数
    int *status 是一个输出型参数,用于获取子进程的退出状态(不关心则可传入 NULL)。
  • 作用
    :等待任意一个退出的子进程。只要有任意一个子进程退出,wait 就会立刻回收它并返回。
  • 返回值
    : 
    • 回收成功
      :返回目标僵尸进程的pid。
    • 回收失败
      :返回-1。

  如果父进程在调用wait接口时,其关注的子进程尚未退出,父进程默认会 阻塞 在调用处(其行为类似于 scanf 的等待输入),直到子进程退出才继续向下执行。

#include<iostream>#include<unistd.h>#include<sys/types.h>#include<sys/wait.h>using namespace std;intFunc01(){// 创建子进程// fork() 给子进程返回 0,给父进程返回子进程的 PID	pid_t id = fork();if(id == 0){// === 子进程执行分支 ===int cnt = 5;while(cnt){			pid_t _pid = getpid();			cout << "我是一个子进程" << "我的PID是:" << _pid << endl;sleep(1); // 每隔 1 秒打印一次			cnt--;}// 子进程运行 5 秒后退出,此时父进程还在 sleep(7),子进程将进入僵尸状态(Zombie)exit(0); }// === 父进程执行分支 ===// 关键点 1:父进程先休眠 7 秒。// 此时子进程在前 5 秒正常运行,后 2 秒由于父进程未回收它,子进程处于僵尸状态。sleep(7); // 关键点 2:父进程调用 wait 阻塞式回收任意子进程。// 因为此时子进程已经退出,wait 会立刻成功回收,消除僵尸进程,并返回被回收子进程的 PID。// 传入 NULL 表示父进程不关心子进程的退出状态(退出码/信号)。	pid_t rid = wait(NULL); if(rid > 0{// 回收成功,打印被回收的子进程 PID		cout << rid << endl; }// 关键点 3:子进程被成功回收后,父进程再次休眠 7 秒。// 此时通过 ps 命令观察,可以发现原本处于僵尸状态(Z)的子进程已经被彻底清除。sleep(7); return 0;}intmain(){Func01();//Func02();//Func03();return 0;}

2.3 waitpid 函数详解

  相比 waitwaitpid 提供了更加精准和灵活的控制。

pid_twaitpid(pid_t pid, int *status, int options);

2.3.1 参数 pid 的取值与含义

  参数 pid 用于指定父进程想要等待的目标子进程, 其取值具有不同的控制粒度:

  • < -1
    :等待其进程组ID等于 pid 绝对值的任意子进程。
  • -1:等待任意子进程,此时的功能与 wait 类似。
  • 0
    :等待与调用进程属于同一个进程组的任意子进程。
  • > 0:等待特定子进程。

2.3.2 参数 options 的控制

options 参数用来控制等待的方式(阻塞或非阻塞),常见的核心选项为:

  • 0
    :默认行为。如果子进程未退出,父进程将在调用处保持阻塞等待
  • WNOHANG
    :若指定的子进程没有结束,则 waitpid() 函数不会阻塞,而是立即返回 0,允许父进程去执行其他任务(非阻塞轮询)。

2.4详细讲解options参数

2.4.1怎么记忆这个选项——题外话

  你怎么记这个选项:“WNOHANG” 你仔细去读它的音,H-ANG-夯,夯住了,我们说电脑卡住了(阻塞),就是说它夯住了(江浙一带/或者北京的方言中有这么说的,此方也是浙江人),W是等待wait,N是no,这个选项直接翻译过来就是“等待的时候不要夯住”。   那么有人想要问:什么是阻塞?什么是非阻塞?

2.4.2 阻塞等待与非阻塞等待

  张三想要约李四下来喝酒。李四说他需要上楼拿点东西准备一下。

  • 非阻塞等待(轮询检测): 张三在楼下等待。他等了一会儿,打电话给李四问:“你好了吗?”李四回复:“快了快了。”然后挂断了电话。张三又等了半天,期间拿出手机刷了一会儿短视频,接着再次打电话过去问:“好了吗?”李四回答:“马上好。”然后又挂断了电话。张三如此反复,一共给李四打了五通电话。最终,李四终于下楼了。

    这就是非阻塞等待。 张三在等待期间可以做自己的事情(比如刷视频),每隔一段时间主动打电话确认状态,这种重复检测的过程就是非阻塞轮询

  • 阻塞等待: 今天张三又来约李四喝酒。这一次,张三给李四打电话时说道:“在你想好、收拾好并走下来之前,千万不要挂断电话,我就一直在线上等着你。”

    这就是阻塞等待。 张三挂起当前的其他活动,不执行任何其他操作,电话一直保持接通状态,直到满足条件(李四下楼)为止。

2.4.3非阻塞等待的代码

补充一下:非阻塞轮询的时候,这个waitpid的返回值情况:

  • 大于0
    :等待结束,子进程pid。
  • 等于0
    :调用结束,但是子没有退出。
  • 小于0
    :等待失败。
#include<iostream>#include<unistd.h>#include<sys/types.h>#include<sys/wait.h>#include<cstdlib>using namespace std;intFunc(){    // 创建子进程    pid_t id = fork();    if(id == 0){        // ================= 子进程执行流 =================        int cnt = 5;        while(cnt){            pid_t _pid = getpid();            cout << "我是一个子进程" << "我的PID是:" << _pid << endl;            sleep(1); // 每隔1秒打印一次            cnt--;        }        // 子进程运行5秒后退出,退出码设为 0        exit(0);    }    // ================= 父进程执行流 =================    // 父进程先睡眠1秒,拉开与子进程执行的步调    sleep(1);    // 开始非阻塞轮询等待(像张三反复打电话给李四一样)    while(1){        int statue = 0;        // 使用 WNOHANG 参数进行非阻塞等待        // id: 要等待的子进程PID        // &statue: 获取子进程退出状态的输出型参数        // WNOHANG: 若子进程未结束,函数不阻塞,立即返回0        pid_t rid = waitpid(id, &statue, WNOHANG);        if(rid > 0)        {            // 情况1:返回值大于0,说明等待成功,子进程已经退出            // WEXITSTATUS(statue) 用于提取子进程的退出码(即exit里的值)            cout << "等待成功,子进程的退出码为" << WEXITSTATUS(statue) << endl;            break// 成功回收子进程,退出轮询        }        else if(rid == 0){            // 情况2:返回值为0,说明子进程还在运行,本次检测未捕获到其退出            // 此时父进程不会被挂起,可以继续执行后续代码(这里选择打印并休眠后再次轮询)            cout << "执行第2次等待" << "子进程未退出" << endl;            sleep(1); // 等待1秒后,进入下一次轮询检测        }        else {            // 情况3:返回值小于0,说明等待出错(例如传入了不存在的进程PID)            cout << "等待失败" << endl;            break;        }    }    return 0;}intmain(){    Func();    return 0;}

   那么。是不是得给父进程找点事情干干?怎么干?我们有两种方法:C++11的function<>或者是C的函数指针。我们设计一个.

#include<iostream>#include<vector>#include<functional>#include<unistd.h>#include<sys/types.h>#include<sys/wait.h>#include<cstdlib>using namespace std;// 定义任务类型using task_t = function<void()>;// 模拟父进程在轮询期间需要处理的各种轻量级任务voidDownloadTask(){ cout << "【父进程并行任务】正在下载网络数据..." << endl; }voidLogTask(){ cout << "【父进程并行任务】正在向日志文件写入状态..." << endl; }voidCheckTask(){ cout << "【父进程并行任务】正在检测系统内存占用..." << endl; }intFunc(){    // 1. 初始化父进程的任务列表    vector<task_t> tasks;    tasks.push_back(DownloadTask);    tasks.push_back(LogTask);    tasks.push_back(CheckTask);    pid_t id = fork();    if (id == 0) {        // ================= 子进程执行流 =================        int cnt = 5;        while (cnt) {            cout << "我是子进程,PID: " << getpid() << ", 正在运行..." << endl;            sleep(1);            cnt--;        }        exit(0);    }    // ================= 父进程执行流 =================    while (1) {        int status = 0;        // 使用 WNOHANG 进行非阻塞轮询        pid_t rid = waitpid(id, &status, WNOHANG);        if (rid > 0) {            // 情况1:子进程退出,成功回收            if (WIFEXITED(status)) {                cout << "等待成功,子进程退出码: " << WEXITSTATUS(status) << endl;            }            break;        }         else if (rid == 0) {            // 情况2:子进程还未退出,父进程利用这个空档期执行自己的任务            cout << "---------------------------------------------" << endl;            cout << "子进程暂未退出,父进程开始处理轮询任务..." << endl;            // 遍历并执行任务列表中的轻量级任务            for (const auto& task : tasks) {                task();             }            cout << "---------------------------------------------" << endl;            sleep(1); // 减轻轮询频率,每隔1秒检测一次        }         else {            // 情况3:等待出错            perror("waitpid error");            break;        }    }    return 0;}intmain(){    Func();    return 0;}

三、 深入理解 status 状态参数

3.0进程的退出信息到底是怎么被父进程获取的

  先问你一个问题:父进程能不能直接获取子进程的退出信息?答案是不可以。因为进程之间相互独立。谁可以获取进程的退出信息?操作系统,所以父进程要获取退出信息找谁要!?找操作系统要。怎么要?waitpid/wait系统调用。   在 Linux 内核中,子进程即使退出了,其 task_struct 依然被保留在操作系统的进程表里。在子进程的 task_struct 内部,维护着类似以下的字段:

long exit_state;int exit_code, exit_signal;
  1. 当子进程退出时,操作系统会将其退出的错误码和信号写入到它自身的 exit_code 和 exit_signal 中。
  2. 父进程调用 waitpid(&status) 时,会通过系统调用陷入内核。
  3. 操作系统切换到父进程的上下文,读取子进程 task_struct 中的 exit_code 和 exit_signal
  4. 操作系统将这两个值按照位图规则打包,写入父进程传入的 status 变量的内存空间中。
  5. 提取完成后,操作系统才真正地将子进程的 task_struct 从内存中清理、销毁。

  这也就完美解释了“为什么要存在僵尸进程”——为了等待父进程来读取这些保存在内核结构里的退出状态。

getpid()这些接口也是差不多原理。

3.1 status 的位图结构

wait 和 waitpid 的 status 参数是一个整型指针。它不能简单地当作普通的整数来看待,在系统内核中,它被当作一个位图结构来处理。

3.1.1 正常终止(Normal Termination)

  当代码运行完毕,进程正常退出时(例如 main 函数返回或调用 exit()),status 的低 16 位结构如下:

  • 次低 8 位(第 8 到 15 比特位)
    :保存子进程的退出码
  • 低 7 位(第 0 到 6 比特位)
    :其值全部为 0
  • 第 7 比特位
    core dump 标志位(默认为 0)。

core dump 标志位是什么?不讲。得等待信号章节才能讲。

正常退出的status代码演示

#include<stdio.h>#include<stdlib.h>#include<unistd.h>#include<sys/types.h>#include<sys/wait.h>intmain(){    pid_t id = fork();    if (id < 0) {        perror("fork");        return 1;    }     else if (id == 0) {        int cnt = 3;        while (cnt) {            printf("我是一个子进程,pid : %d, ppid : %d\n"getpid(), getppid());            sleep(1);            cnt--;        }        exit(1); // 退出码为 1    }     else {        int status = 0;        pid_t rid = waitpid(id, &status, 0);        if (rid > 0) {            printf("wait success, rid: %d, status: %d\n", rid, status);        }    }    return 0;}

  打印结果是什么?256。哎?怎么是256呢?再仔细想一想,第八位是1,0~7位是0,是不是确实是256?是的。

3.1.2 被信号所杀(Signaled Termination)

  当进程由于遭遇异常(如除 0 错误、野指针访问)而被系统生成的信号强制终止时,退出码便失去了意义:

  • 低 7 位(第 0 到 6 比特位)
    :保存导致子进程终止的终止信号
  • 次低 8 位
    :未启用(无意义)。
  • 第 7 比特位
    core dump 标志位。

无异常检测的标准(如果进程没有发生异常)

  1. 低 7 个比特位必定为 0
  2. 一旦发现低 7 个比特位不为 0则说明进程是异常退出的,此时提取出的退出码将毫无意义。

3.2 通过 status 获取退出信息与信号

3.2.1 传统方法:位运算提取

  我们可以直接通过位操作从 status 中截取对应的比特位。

#include<iostream>#include<unistd.h>#include<sys/wait.h>#include<sys/types.h>#include<cstdlib>using namespace std;intFunc02(){    pid_t id = fork();    if (id == 0)    {        int cnt = 5;        while (cnt)        {            cout << "我是一个子进程,我的PID是: " << getpid() << endl;            sleep(1);            cnt--;        }        exit(105); // 示例:以退出码 105 退出    }    int status = 0;    pid_t rid = waitpid(id, &status, 0);    if (rid > 0)    {        // (status >> 8) & 0xFF: 右移 8 位并按位与 0xFF,提取次低 8 位的退出码        // status & 0x7F: 按位与 0x7F,提取最低 7 位的终止信号        printf("wait success, rid: %d, exit code: %d, exit signal: %d\n"               rid, (status >> 8) & 0xFF, status & 0x7F);    }    else    {        perror("waitpid failed");    }    return 0;}

3.2.2 系统标准方法:宏函数提取

  相比手动进行位运算,Linux 系统提供了标准宏函数,能更安全、直观地解析 status

  • WIFEXITED(status)
    :若子进程正常终止,返回真(True)。
  • WEXITSTATUS(status)
    :在 WIFEXITED 为真的前提下,用于提取子进程的退出码
  • WIFSIGNALED(status)
    :若子进程因信号异常终止,返回真(True)。
  • WTERMSIG(status)
    :在 WIFSIGNALED 为真的前提下,用于提取终止信号
intFunc02_Macro(){    pid_t id = fork();    if (id == 0)    {        int cnt = 5;        while (cnt)        {            cout << "我是一个子进程,我的PID是: " << getpid() << endl;            sleep(1);            cnt--;        }        exit(0);    }    int status = 0;    pid_t rid = waitpid(id, &status, 0);    if (rid > 0)    {        // 优先判断是否正常退出        if (WIFEXITED(status))        {            cout << "wait success, exit code: " << WEXITSTATUS(status) << endl;        }        else if (WIFSIGNALED(status))        {            cout << "child process killed by signal: " << WTERMSIG(status) << endl;        }    }    else    {        perror("waitpid failed");    }    return 0;}

好的本期内容就到这里,如果对你有帮助,还不要忘记点赞三联支持。我是此方,我们下期再见。bye!

最新文章

随机文章

基本 文件 流程 错误 SQL 调试
  1. 请求信息 : 2026-08-25 19:14:25 HTTP/2.0 GET : https://f.mffb.com.cn/a/512186.html
  2. 运行时间 : 0.235408s [ 吞吐率:4.25req/s ] 内存消耗:4,600.61kb 文件加载:140
  3. 缓存信息 : 0 reads,0 writes
  4. 会话信息 : SESSION_ID=fcb56cc675fdbd62aeef67ce8fc0a6f4
  1. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/public/index.php ( 0.79 KB )
  2. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/autoload.php ( 0.17 KB )
  3. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/composer/autoload_real.php ( 2.49 KB )
  4. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/composer/platform_check.php ( 0.90 KB )
  5. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/composer/ClassLoader.php ( 14.03 KB )
  6. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/composer/autoload_static.php ( 4.90 KB )
  7. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/helper.php ( 8.34 KB )
  8. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-validate/src/helper.php ( 2.19 KB )
  9. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/helper.php ( 1.47 KB )
  10. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/stubs/load_stubs.php ( 0.16 KB )
  11. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Exception.php ( 1.69 KB )
  12. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-container/src/Facade.php ( 2.71 KB )
  13. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/deprecation-contracts/function.php ( 0.99 KB )
  14. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/polyfill-mbstring/bootstrap.php ( 8.26 KB )
  15. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/polyfill-mbstring/bootstrap80.php ( 9.78 KB )
  16. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/var-dumper/Resources/functions/dump.php ( 1.49 KB )
  17. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-dumper/src/helper.php ( 0.18 KB )
  18. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/var-dumper/VarDumper.php ( 4.30 KB )
  19. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/App.php ( 15.30 KB )
  20. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-container/src/Container.php ( 15.76 KB )
  21. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/psr/container/src/ContainerInterface.php ( 1.02 KB )
  22. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/provider.php ( 0.19 KB )
  23. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Http.php ( 6.04 KB )
  24. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/helper/Str.php ( 7.29 KB )
  25. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Env.php ( 4.68 KB )
  26. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/common.php ( 0.03 KB )
  27. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/helper.php ( 18.78 KB )
  28. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Config.php ( 5.54 KB )
  29. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/app.php ( 0.95 KB )
  30. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/cache.php ( 0.78 KB )
  31. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/console.php ( 0.23 KB )
  32. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/cookie.php ( 0.56 KB )
  33. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/database.php ( 2.48 KB )
  34. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/facade/Env.php ( 1.67 KB )
  35. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/filesystem.php ( 0.61 KB )
  36. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/lang.php ( 0.91 KB )
  37. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/log.php ( 1.35 KB )
  38. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/middleware.php ( 0.19 KB )
  39. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/route.php ( 1.89 KB )
  40. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/session.php ( 0.57 KB )
  41. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/trace.php ( 0.34 KB )
  42. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/view.php ( 0.82 KB )
  43. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/event.php ( 0.25 KB )
  44. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Event.php ( 7.67 KB )
  45. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/service.php ( 0.13 KB )
  46. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/AppService.php ( 0.26 KB )
  47. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Service.php ( 1.64 KB )
  48. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Lang.php ( 7.35 KB )
  49. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/lang/zh-cn.php ( 13.70 KB )
  50. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/initializer/Error.php ( 3.31 KB )
  51. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/initializer/RegisterService.php ( 1.33 KB )
  52. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/services.php ( 0.14 KB )
  53. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/service/PaginatorService.php ( 1.52 KB )
  54. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/service/ValidateService.php ( 0.99 KB )
  55. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/service/ModelService.php ( 2.04 KB )
  56. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-trace/src/Service.php ( 0.77 KB )
  57. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Middleware.php ( 6.72 KB )
  58. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/initializer/BootService.php ( 0.77 KB )
  59. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/Paginator.php ( 11.86 KB )
  60. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-validate/src/Validate.php ( 63.20 KB )
  61. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/Model.php ( 23.55 KB )
  62. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/Attribute.php ( 21.05 KB )
  63. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/AutoWriteData.php ( 4.21 KB )
  64. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/Conversion.php ( 6.44 KB )
  65. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/DbConnect.php ( 5.16 KB )
  66. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/ModelEvent.php ( 2.33 KB )
  67. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/RelationShip.php ( 28.29 KB )
  68. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/contract/Arrayable.php ( 0.09 KB )
  69. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/contract/Jsonable.php ( 0.13 KB )
  70. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/contract/Modelable.php ( 0.09 KB )
  71. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Db.php ( 2.88 KB )
  72. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/DbManager.php ( 8.52 KB )
  73. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Log.php ( 6.28 KB )
  74. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Manager.php ( 3.92 KB )
  75. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/psr/log/src/LoggerTrait.php ( 2.69 KB )
  76. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/psr/log/src/LoggerInterface.php ( 2.71 KB )
  77. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Cache.php ( 4.92 KB )
  78. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/psr/simple-cache/src/CacheInterface.php ( 4.71 KB )
  79. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/helper/Arr.php ( 16.63 KB )
  80. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/cache/driver/File.php ( 7.84 KB )
  81. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/cache/Driver.php ( 9.03 KB )
  82. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/contract/CacheHandlerInterface.php ( 1.99 KB )
  83. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/Request.php ( 0.09 KB )
  84. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Request.php ( 55.78 KB )
  85. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/middleware.php ( 0.25 KB )
  86. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Pipeline.php ( 2.61 KB )
  87. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-trace/src/TraceDebug.php ( 3.40 KB )
  88. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/middleware/SessionInit.php ( 1.94 KB )
  89. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Session.php ( 1.80 KB )
  90. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/session/driver/File.php ( 6.27 KB )
  91. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/contract/SessionHandlerInterface.php ( 0.87 KB )
  92. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/session/Store.php ( 7.12 KB )
  93. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Route.php ( 23.73 KB )
  94. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/RuleName.php ( 5.75 KB )
  95. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/Domain.php ( 2.53 KB )
  96. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/RuleGroup.php ( 22.43 KB )
  97. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/Rule.php ( 26.95 KB )
  98. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/RuleItem.php ( 9.78 KB )
  99. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/route/app.php ( 1.72 KB )
  100. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/facade/Route.php ( 4.70 KB )
  101. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/dispatch/Controller.php ( 4.74 KB )
  102. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/Dispatch.php ( 10.44 KB )
  103. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/controller/Index.php ( 4.81 KB )
  104. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/BaseController.php ( 2.05 KB )
  105. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/facade/Db.php ( 0.93 KB )
  106. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/connector/Mysql.php ( 5.44 KB )
  107. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/PDOConnection.php ( 52.47 KB )
  108. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/Connection.php ( 8.39 KB )
  109. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/ConnectionInterface.php ( 4.57 KB )
  110. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/builder/Mysql.php ( 16.58 KB )
  111. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/Builder.php ( 24.06 KB )
  112. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/BaseBuilder.php ( 27.50 KB )
  113. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/Query.php ( 15.71 KB )
  114. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/BaseQuery.php ( 45.13 KB )
  115. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/TimeFieldQuery.php ( 7.43 KB )
  116. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/AggregateQuery.php ( 3.26 KB )
  117. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/ModelRelationQuery.php ( 20.07 KB )
  118. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/ParamsBind.php ( 3.66 KB )
  119. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/ResultOperation.php ( 7.01 KB )
  120. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/WhereQuery.php ( 19.37 KB )
  121. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/JoinAndViewQuery.php ( 7.11 KB )
  122. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/TableFieldInfo.php ( 2.63 KB )
  123. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/Transaction.php ( 2.77 KB )
  124. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/log/driver/File.php ( 5.96 KB )
  125. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/contract/LogHandlerInterface.php ( 0.86 KB )
  126. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/log/Channel.php ( 3.89 KB )
  127. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/event/LogRecord.php ( 1.02 KB )
  128. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/Collection.php ( 16.47 KB )
  129. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/facade/View.php ( 1.70 KB )
  130. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/View.php ( 4.39 KB )
  131. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Response.php ( 8.81 KB )
  132. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/response/View.php ( 3.29 KB )
  133. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Cookie.php ( 6.06 KB )
  134. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-view/src/Think.php ( 8.38 KB )
  135. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/contract/TemplateHandlerInterface.php ( 1.60 KB )
  136. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-template/src/Template.php ( 46.61 KB )
  137. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-template/src/template/driver/File.php ( 2.41 KB )
  138. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-template/src/template/contract/DriverInterface.php ( 0.86 KB )
  139. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/runtime/temp/067d451b9a0c665040f3f1bdd3293d68.php ( 11.98 KB )
  140. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-trace/src/Html.php ( 4.42 KB )
  1. CONNECT:[ UseTime:0.000947s ] mysql:host=127.0.0.1;port=3306;dbname=f_mffb;charset=utf8mb4
  2. SHOW FULL COLUMNS FROM `fenlei` [ RunTime:0.001224s ]
  3. SELECT * FROM `fenlei` WHERE `fid` = 0 [ RunTime:0.000550s ]
  4. SELECT * FROM `fenlei` WHERE `fid` = 63 [ RunTime:0.003942s ]
  5. SHOW FULL COLUMNS FROM `set` [ RunTime:0.001091s ]
  6. SELECT * FROM `set` [ RunTime:0.000419s ]
  7. SHOW FULL COLUMNS FROM `article` [ RunTime:0.001115s ]
  8. SELECT * FROM `article` WHERE `id` = 512186 LIMIT 1 [ RunTime:0.012534s ]
  9. UPDATE `article` SET `lasttime` = 1787656465 WHERE `id` = 512186 [ RunTime:0.018194s ]
  10. SELECT * FROM `fenlei` WHERE `id` = 67 LIMIT 1 [ RunTime:0.001348s ]
  11. SELECT * FROM `article` WHERE `id` < 512186 ORDER BY `id` DESC LIMIT 1 [ RunTime:0.000903s ]
  12. SELECT * FROM `article` WHERE `id` > 512186 ORDER BY `id` ASC LIMIT 1 [ RunTime:0.000902s ]
  13. SELECT * FROM `article` WHERE `id` < 512186 ORDER BY `id` DESC LIMIT 10 [ RunTime:0.021590s ]
  14. SELECT * FROM `article` WHERE `id` < 512186 ORDER BY `id` DESC LIMIT 10,10 [ RunTime:0.014700s ]
  15. SELECT * FROM `article` WHERE `id` < 512186 ORDER BY `id` DESC LIMIT 20,10 [ RunTime:0.028430s ]
0.238413s