linux 进程调度策略
来源:互联网 发布:如何解析json数据 编辑:程序博客网 时间:2024/05/16 10:26
Scheduling Policies
The operating system supports four scheduling policies for threads. A thread object's scheduling policy is determined by the setting of the scheduling policy attribute in its thread attributes object at the time the thread is created. The scheduling policy attribute describes how the thread is scheduled for execution relative to the other threads in the program.
A thread has one of the following scheduling policies described in the following subsections. Only the SCHED_FIFO
and SCHED_RR
scheduling policies are portable. The symbol name SCHED_OTHER
itself is portable, but it specifies behavior that may vary from one POSIX.1c standard implementation to another.
All threads, regardless of scheduling policy, are scheduled in a single priority space from 0 to 63. That is, a thread at priority 63 will always be chosen to run before a thread at priority 62 even if the lower priority thread is SCHED_FIFO
while the higher priority thread is SCHED_OTHER
. Unblocking a thread inSCHED_FIFO
or SCHED_RR
policy, with higher priority, will preempt a running thread of lower priority. Unblocking a thread in SCHED_OTHER
(or SCHED_FG_NP
orSCHED_BG_NP
) will not preempt a running thread. Threads with SCHED_FIFO
or SCHED_RR
policy will be awakened in priority order from the mutex, condition variable, and read-write lock waits. Threads in other policies will be awakened in priority order if SCHED_RR
or SCHED_FIFO
threads are concurrently waiting on the same object; otherwise they are awakened in FIFO order.
For more information about the scheduling policies supported by the operating system, see Guide to the POSIX Threads Library.
1 SCHED_FIFO
(first-in/first-out scheduling)
Under this scheduling policy, the highest priority thread runs until it blocks. If there is more than one thread with the same priority and that priority is the highest among other threads, the first thread to begin running continues until it blocks. If a thread with this policy becomes ready, and it has a higher priority than the currently running thread, then it preempts the current thread and begins running immediately.
2 SCHED_RR
(round-robin scheduling)
Under this scheduling policy, the highest priority thread runs until it blocks; however, threads of equal priority, if that priority is the highest among other threads, are timesliced. Timeslicing is a mechanism that ensures that every thread is allowed time to execute by preempting running threads at fixed intervals.) If a thread with this policy becomes ready, and it has a higher priority than the currently running thread, then it preempts the current thread and begins running immediately.
3 SCHED_FG_NP
(foreground scheduling; also known as SCHED_OTHER
)
This is default scheduling policy. Under this scheduling policy, all threads are timesliced. All threads receive some scheduling regardless of priority. Therefore, no thread is completely denied execution time. Higher priority threads receive more execution time than lower priority threads. Threads with this scheduling policy can be denied execution time by SCHED_FIFO
or SCHED_RR
threads.
4 SCHED_BG_NP
(background scheduling)
Under this scheduling policy, like the default SCHED_FG_NP
scheduling policy, all threads receive some scheduling, regardless of priority. However, background threads can be denied execution time by SCHED_FIFO
or SCHED_RR
threads, and receive less execution time than SCHED_FG_NP
threads.
- linux进程调度策略
- linux进程调度策略
- Linux进程调度策略
- linux 进程调度策略
- Linux进程调度策略
- linux进程调度策略
- Linux进程调度策略
- Linux进程调度策略
- Linux中的进程调度策略
- linux进程调度算法:分时调度策略、FIFO调度策略、RR调度策略
- Linux应用程序设置进程调度策略
- linux内核CFS进程调度策略
- Linux 进程调度策略参考博文
- linux CFS进程时间片调度策略
- Linux应用程序设置进程调度策略
- linux进程调度之 FIFO 和 RR 调度策略
- linux进程调度之 FIFO 和 RR 调度策略
- linux进程调度之 FIFO 和 RR 调度策略
- java 中的 '\0'
- block
- HDU 4281 Judges' response 状态压缩 01背包 MTSP
- 笛卡儿积的Java算法实现
- Codeforces Round #290 (Div. 1)B. Fox And Jumping
- linux 进程调度策略
- javascript对url进行encode的两种方式
- POJ 3294 (UVA 11107) Life Forms 后缀数组
- Java线程面试题 Top 50
- hdu 2846 Repository 字典树的一种变形
- Func和Action,委托与lambda表达式,一看就知道
- iOS开发_剪贴板操作_复制粘贴功能
- 猴子爬山的问题
- Oracle的物理存储结构