zoukankan      html  css  js  c++  java
  • 国嵌内核驱动进阶班-7-2(内核等待队列)

    定义和初期化

    定义等待队列

    wait_queue_head_t myqueue;

    初始化等待队列

    init_waitqueue_head(&myqueue)

    定义并初始化等待队列

    DECLARE_WAIT_QUEUE_HEAD(myqueue)


    睡眠

    • 条件睡眠

    当condition为真时,立即执行;

    wait_event(queue, condition)

    当condition为假时,进入TASK_UNINTERRUPTIBLE;

    wait_event_interruptible(queue, condition)

    当condition为假时,进入TASK_INTERRUPTIBLE;

    wait_event_killable(queue, condition)

     当condition为假时,进入TASK_KILLABLE

    • 无条件睡眠

        sleep_on(queue)

        interruptible_sleep_on(queue)


    唤醒

    wait_up(queue)

    唤醒所有进程(TASK_UNINTERRUPTIBLE,TASK_INTERRUPTIBLE,TASK_KILLABLE)

    wait_up_interruptible(queue)

     唤醒TASK_INTERRUPTIBLE的进程

  • 相关阅读:
    相关系数
    T检验
    Python模块常用的几种安装方式
    DOM与SAX读取XML方式的不同
    Base64编码
    node.js网页爬虫
    Node.js Express 框架
    Node.js Web 模块
    Node.js GET/POST请求
    Node.js 常用工具
  • 原文地址:https://www.cnblogs.com/renhl/p/4550582.html
Copyright © 2011-2022 走看看