首 页 | 新 闻 | Symbian | Android| Windows Mobile | J2ME | 下载中心 | 游戏策划招聘与求职 | 购书指南 | 视频教程
您现在的位置: 开发视界 >> 专家专栏 >> Symbian翻译小组 >> Symbian OS SDK V8.1a >> Symbian OS guide >> Base >> Using User Library >> Memory Management >> concepts >> 文章正文
线程与进程的优先级
作者:LeeFJ    文章来源:PhonerCN    更新时间:2006-5-9 0:34:23
译者:LeeFJ
 
SYMBIAN OS SDK V8.1A   

--------------------------------------------------------------------------------

 » Symbian OS SDK v8.1a » Symbian OS guide » Base » Using User Library (E32) » Thread And Process Management » Using Threads and Processes » Thread and process priorities
--------------------------------------------------------------------------------

Thread and Process Priorities
线程与进程的优先级

At any time, the thread running is the one with the highest priority which is ready to run. The priority of a thread is simply a number; the value determines the priority; the greater the number, the higher the priority.
在任何时候,运行中的线程总是所有具有最高优先级线程中的一个,并且之前已经处于就绪状态。线程的优先级只是一个简单的数字;这个数字决定了线程的优先级;数字越大那么优先级也就越高。

This value is termed the absolute priority of the thread and is calculated from the priority values assigned through the API to both the thread and the process which owns that thread.

这个值被决定了线程的绝对优先级,这个绝对优先级是通过API赋值给线程的优先级以及它所在进程的优先级共同计算得到的。

 

A process can take one of eight discrete priority values; these are the individual enumerators of the TProcessPriority enumeration, defined in e32std.h, and range from EPriorityLow, the lowest, to EPrioritySupervisor, the highest.
进程可以使用8个优先级,这些都是定义在TProcessPriority中独立的枚举变量,TProcessPriority 在e32std.h中定义。它的范围从最低的EPriorityLow到最高的EPrioritySupervisor。


In practice, user processes can only be assigned priorities that are less than EPriorityWindowServer, i.e. a user process can only be assigned one of the values:
在实际应用中,用户进程可以得到的优先级总是要小于EPriorityWindowServer。也就是说,用户进程只可以得到以下优先级中的一个:

EPriorityLow

EPriorityBackground

EPriorityForeGround

EPriorityHigh

A process priority can be assigned:
进程的优先级可以被赋值:

· when the associated .exe is built; this is done by specifying the value in the .mmp file that defines the project.
当与之相关的.exe文件被生成的时候。这个可以通过工程中的.mmp文件来指定。
(译者:关于这个可以查看 mmp语句的 epocprocesspriority )

· using RProcess::SetPriority().
使用RProcess::SetPriority().

--------------------------------------------------------------------------------

See also
Using Makmake in the Build Tools Guide.


--------------------------------------------------------------------------------
Copyright ©2005  Symbian Ltd.       unknown-build-id

相关文章:
线程的终止
线程赋值的相对优先级
线程的绝对优先级别
固化进程
进程与线程简介
线程和进程 ID
进程类型
异常处理
 

站点地图 | 加入收藏 | 联系站长 | 广告服务 |
QQ:280529124  Tel:0592-8271361 辽ICP备05021703号