首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 嵌入开发 > 驱动开发 >

linux优先级解决方法

2012-09-12 
linux优先级sched_rr,sched_fifo.优先级大小是怎么排的?我sched_get_priority_min值是1,优先级最大是1还是

linux优先级
sched_rr,sched_fifo.优先级大小是怎么排的?我sched_get_priority_min值是1,优先级最大是1还是99?
我看网上有说99是优先级最大的,也有说1是最大的。我内核中的注释是这样的
/*
 * Priority of a process goes from 0..MAX_PRIO-1, valid RT
 * priority is 0..MAX_RT_PRIO-1, and SCHED_NORMAL/SCHED_BATCH
 * tasks are in the range MAX_RT_PRIO..MAX_PRIO-1. Priority
* values are inverted: lower p->prio value means higher priority.
 *
 * The MAX_USER_RT_PRIO value allows the actual maximum
 * RT priority to be separate from the value exported to
 * user-space. This allows kernel threads to set their
 * priority to a value higher than any user task. Note:
 * MAX_RT_PRIO must not be smaller than MAX_USER_RT_PRIO.
 */

#define MAX_USER_RT_PRIO100
#define MAX_RT_PRIOMAX_USER_RT_PRIO

#define MAX_PRIO(MAX_RT_PRIO + 40)
#define DEFAULT_PRIO(MAX_RT_PRIO + 20)

究竟优先级设成什么值最大?

[解决办法]
Priority
* values are inverted: lower p->prio value means higher priority.

-----------

0是最大的 越低越好

用户只能使用优先级低一些的

热点排行