pthread调度方法? [英] pthread scheduling methods?

查看:58
本文介绍了pthread调度方法?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在没有明确调度的情况下,pthread 被调度为由内核以随机方式运行.

With no explicit scheduling, pthreads are scheduled to run by the kernel in a random manner.

pthread 库中是否有针对优先级等相同的调度方法?

Are there any scheduling methods defined in the pthread library for the same such as priorities?

推荐答案

线程的优先级被指定为一个增量,它被添加到进程的优先级中.更改进程的优先级会影响该进程内所有线程的优先级.线程的默认优先级是 DEFAULT_PRIO_NP,与进程优先级没有变化.

The priority of a thread is specified as a delta which is added to the priority of the process. Changing the priority of the process, effects the priority of all of the threads within that process. The default priority for a thread is DEFAULT_PRIO_NP, which is no change from the process priority.

这些 Pthread API 仅支持 SCHED_OTHER 的调度策略.

These Pthread APIs support only a scheduling policy of SCHED_OTHER.

  1. pthread_setschedparam(仅支持SCHED_OTHER)
  2. pthread_getschedparam
  3. pthread_attr_setschedparam
  4. pthread_attr_getschedparam

AS/400 线程与系统中的其他线程竞争调度资源,而不仅仅是与进程中的其他线程竞争.调度器是基于若干延迟成本曲线(优先级范围)的延迟成本调度器.Posix 标准和 Single Unix Specification 将此称为调度范围和调度策略,在此实现中无法更改 SCHED_OTHER 的默认值.

An AS/400 thread competes for scheduling resources against other threads in the system, not solely against other threads in the process. The scheduler is a delay cost scheduler based on several delay cost curves (priority ranges). The Posix standard and the Single Unix Specification refers to this as scheduling scope and scheduling policy, which on this implementation cannot be changed from the default of SCHED_OTHER.

这篇关于pthread调度方法?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆