PRThreadPriority 编辑

A thread's priority setting.

Syntax

#include <prthread.h>

typedef enum PRThreadPriority
{
   PR_PRIORITY_FIRST   = 0,
   PR_PRIORITY_LOW     = 0,
   PR_PRIORITY_NORMAL  = 1,
   PR_PRIORITY_HIGH    = 2,
   PR_PRIORITY_URGENT  = 3,
   PR_PRIORITY_LAST    = 3
} PRThreadPriority;

Enumerators

PR_PRIORITY_FIRST
Placeholder.
PR_PRIORITY_LOW
The lowest possible priority. This priority is appropriate for threads that are expected to perform intensive computation.
PR_PRIORITY_NORMAL
The most commonly expected priority.
PR_PRIORITY_HIGH
Slightly higher priority than PR_PRIORITY_NORMAL. This priority is for threads performing work of high urgency but short duration.
PR_PRIORITY_URGENT
Highest priority. Only one thread at a time typically has this priority.
PR_PRIORITY_LAST
Placeholder

Description

In general, an NSPR thread of higher priority has a statistically better chance of running relative to threads of lower priority. However, because of the multiple strategies NSPR uses to implement threading on various host platforms, NSPR priorities are not precisely defined. At best they are intended to specify a preference in the amount of CPU time that a higher-priority thread might expect relative to a lower-priority thread. This preference is still subject to resource availability and must not be used in place of proper synchronization.

See Also

Setting Thread Priorities.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据

词条统计

浏览:71 次

字数:2067

最后编辑:7 年前

编辑次数:0 次

    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文