sched_get_priority_max, sched_get_priority_min -让静态优先级范围

内容简介

#include

int sched_get_priority_max(intpolicy);

int sched_get_priority_min(intpolicy);

DESCRIPTION

sched_get_priority_max() returns the maximum priority value that can be used with the scheduling algorithm identified bypolicy.sched_get_priority_min() returns the minimum priority value that can be used with the scheduling algorithm identified bypolicy. Supportedpolicyvalues areSCHED_FIFO,SCHED_RR,SCHED_OTHER, andSCHED_BATCH. Further details about these policies can be found insched_setscheduler(2).

Processes with numerically higher priority values are scheduled before processes with numerically lower priority values. Thus, the value returned bysched_get_priority_max() will be greater than the value returned by sched_get_priority_min().

Linux allows the static priority value range 1 to 99 for SCHED_FIFO and SCHED_RR and the priority 0 for SCHED_OTHER and SCHED_BATCH. Scheduling priority ranges for the various policies are not alterable.

The range of scheduling priorities may vary on other POSIX systems, thus it is a good idea for portable applications to use a virtual priority range and map it to the interval given by sched_get_priority_max() and sched_get_priority_min(). POSIX.1-2001 requires a spread of at least 32 between the maximum and the minimum values forSCHED_FIFO and SCHED_RR.

POSIX systems on which sched_get_priority_max() and sched_get_priority_min() are available define _POSIX_PRIORITY_SCHEDULING in .

返回值

On success,sched_get_priority_max() andsched_get_priority_min() return the maximum/minimum priority value for the named scheduling policy. On error, -1 is returned, anderrnois set appropriately.

错误

标签

描述

EINVAL

参数策略不识别定义的调度策略。

遵循于

POSIX.1-2001.

另请参阅

Programming for the real world - POSIX.4by Bill O. Gallmeister, O’Reilly & Associates, Inc., ISBN 1-56592-074-0

¥ 我要打赏

纠错/补充

收藏

加QQ群啦,易百教程官方技术学习群

注意:建议每个人选自己的技术方向加群,同一个QQ最多限加 3 个群。

linux max 函数,sched_get_priority_max()函数 Unix/Linux相关推荐

  1. 【Linux 内核】进程优先级与调度策略 ② ( 获取调度策略对应的进程优先级函数 | sched_get_priority_max 函数 | sched_get_priority_min 函数 )

    文章目录 一.获取进程优先级函数 二.调度策略参数 三.进程优先级说明 在上一篇博客 [Linux 内核]进程优先级与调度策略 ① ( SCHED_FIFO 调度策略 | SCHED_RR 调度策略 ...

  2. linux c++ 程序运行时间,总结UNIX/LINUX下C++程序计时的方法

    前言 良好的计时器可帮助程序开发人员确定程序的性能瓶颈,或对不同算法进行性能比较.但要精确测量程序的运行时间并不容易,因为进程切换.中断.共享的多用户.网络流量.高速缓存访问及转移预测等因素都会对程序 ...

  3. linux下启动tlq命令,UNIX/LINUX命令

    1 如何查看磁盘使用情况 查看磁盘空间 df -k 可以看出磁盘空间使用情况.以及分区或者逻辑卷的挂载目录等. $ df -k Filesystem 1024-blocks Free %Used Iu ...

  4. linux下 远程桌面连接,Unix/Linux下通过远程桌面连接Windows OS

    不知Microsoft出于什么考虑,在Windows XP中只允许一个Session通过远程桌面连接,如果一台XP为管理工作站,只有它能够访问后端的SAN Switch或存储系统,那么多人将无法同时使 ...

  5. linux中ftok的作用,Unix/Linux编程之ftok函数用法

    linux 中ftok函数的用法 1.函数作用: 系统建立IPC通讯(如消息队列.共享内存时)必须指定一个ID值.通常情况下,该id值通过ftok函数得到 2.函数原型: #include #incl ...

  6. windows下的linux工具,Windows下的Unix/Linux工具集:UnxUtils

    最近用dos命令多了些,感觉方便得多,对付一些老机器特别有效~只是可惜dos命令功效有限,如果能使用到linux系统上类似grep,sed,cat这样命令就完美了~ 果然和想得差不多,网上还真有&qu ...

  7. Unit 3: Unix/Linux File System 3.1 Unix/Linux File System Sleuthkit and Autopsy

    >> Now let's learn and practice a well-known open source forensic analysis tool called Sleuth ...

  8. linux退出脚本命令,【Unix/Linux.Shell Script】退出状态,exit命令

    每一条命令,不管是内置,shell函数,还是外部的,当它退出时,都会返回一个小的整数值给引用它的程序,这是程序的退出状态. 在shell下执行程序时,有许多方式可以取出程序的退出状态. 退出状态值 以 ...

  9. Linux学习:简单基础的Linux系统命令

    Linux操作系统介绍     肯.汤普逊 丹尼斯.里奇     美国 贝尔实验室     1970-1973     BCPL->new B->C->UNIX系统->Mini ...

最新文章

  1. Oracle 12c DG备库Alert报错ORA-01110
  2. Docker部署Zookeeper集群
  3. 王石:我每天都强迫自己做的一件事
  4. pfSense如何创建和配置VLAN
  5. Python matplotlib 和PIL
  6. 分布式认证需求-开放认证体系
  7. 【相对/绝对路径】JavaWeb项目中,请求转发与重定向的路径写法
  8. .NET如何写正确的“抽奖”——数组乱序算法
  9. mysql极客_极客mysql16
  10. 判断是否为IE浏览器(方法一)
  11. 微软拥抱开源_如何拥抱开源劳动力
  12. 你应该了解的python 垃圾回收机制
  13. netsuite中Mutiple Select的赋值问题的解决
  14. linux常见的查看命令
  15. 2d头发_3D打印毛囊突破性进展!“头发工厂”将成秃顶的救星
  16. python定时器毫秒_Python实现定时精度可调节的定时器
  17. linux生成ssl证书给haproxy,如何为多个SSL证书配置HAProxy
  18. ipad上的html编辑器,它让我开始尝试在 iPad 上写作:MWeb for iOS 使用体验
  19. 地理加权回归学习记录
  20. 导入文本文件乱码问题

热门文章

  1. Bzoj 1566: [NOI2009]管道取珠(动态规划-神题)
  2. 【Level 08】U06 Good Feeling L1 End-of-season game
  3. Intel 64/x86_64/IA-32/x86处理器 - 通用指令(5) - 控制转移指令
  4. Intel 64/x86_64/x86/IA-32处理器标志寄存器详解(2) - 32位EFLAGS - 80386(386, Intel386)/80486(486, Intel486)
  5. NI myRIO-1900(ARM9)嵌入式小车2015.8-9
  6. session用法_面试中经常问到的:session和cookie有什么区别?
  7. python怎么让py里面逐行运行_怎样在安卓上运行python
  8. Mosquito的优化——epoll优化(七)
  9. Whitted光线追踪实现
  10. java兔子问题流程图_C语言编程狼追兔子问题代码解析