When you get the scheduling parameters, this member reflects the priority that was assigned to the thread or process. It doesn't reflect any temporary adjustments due to priority inheritance.
When you set the scheduling parameters, set this member to the priority that you want to use. The priority must be between the minimum and maximum values returned by sched_get_priority_min() and sched_get_priority_max() for the scheduling policy.
sched_curpriority
When you get the scheduling parameters, this member is set to the priority that the thread or process is currently running at. This is the value that the kernel uses when making scheduling decisions.
When you set the scheduling parameters, this member is ignored.
The other members are used with sporadic scheduling. The following #define directives create the POSIX names that correspond to those members and should be used instead of accessing members directly.
sched_ss_low_priority
The background or low priority for the thread that's executing.
sched_ss_max_repl
The maximum number of times a replenishment will be scheduled, typically because of a blocking operation. After a thread has blocked this many times, it automatically drops to the low-priority level for the remainder of its execution until its execution budget is replenished.
sched_ss_repl_period
The time that should be used for scheduling the replenishment of an execution budget after being blocked or having overrun the maximum number of replenishments. This time is used as an offset against the time that a thread is made READY.
sched_ss_init_budget
The time that should be used for the thread's execution budget. As the thread runs at its high-priority level, its execution time is carved out of this budget. Once the budget is entirely depleted, the thread drops to its low-priority level, where, if possible because of priority arrangements, it can continue to run until the execution budget is replenished.
The sched_priority must always be higher than sched_ss_low_priority.
The sched_ss_max_repl must be smaller than SS_REPL_MAX.
The sched_ss_init_budget must be larger than sched_ss_repl_period.
文章评论(0条评论)
登录后参与讨论