WEB开发网
开发学院手机开发Symbian 开发 Symbian 操作系统中的线程和进程 阅读

Symbian 操作系统中的线程和进程

 2010-03-18 20:57:00 来源:WEB开发网   
核心提示:7:8: while (finder.Next(fullName) == KErrNone)9: {10: // on success, variable ‘thread’ will contain a handle of11: // a thread found by finder12: thread.Open(fi

7:

8: while (finder.Next(fullName) == KErrNone)

9: {

10: // on success, variable ‘thread’ will contain a handle of

11: // a thread found by finder

12: thread.Open(finder);

13:

14: // get thread’s memory information

15: TInt heapSize, stackSize;

16: thread.GetRamSizes(heapSize, stackSize);

17:

18: // show fullName, heapSize and stackSize

19: ...

20: }

4、线程优先级

线程可以被赋予一个绝对或相对的优先级。绝对优先级定义了这个线程的总体优先级,不需要考虑其拥有者进程的优先级了。而赋予相对优先级时则将此线称定义为拥有者进程的优先级加上该相对优先级后的结果。

下面粗体标示的优先级值可以由用户代码设置:

Code:

enum TProcessPriority

{

EPriorityLow=150,

EPriorityBackground=250,

EPriorityForeground=350,

EPriorityHigh=450,

EPriorityWindowServer=650,

EPriorityFileServer=750,

EPriorityRealTimeServer=850,

EPrioritySupervisor=950

};

enum TThreadPriority

{

EPriorityNull=(-30),

EPriorityMuchLess=(-20),

EPriorityLess=(-10),

EPriorityNormal=0,

EPriorityMore=10,

EPriorityMuchMore=20,

EPriorityRealTime=30,

EPriorityAbsoluteVeryLow=100,

EPriorityAbsoluteLow=200,

EPriorityAbsoluteBackground=300,

EPriorityAbsoluteForeground=400,

EPriorityAbsoluteHigh=500

};

上面枚举出来的值中绝对优先级值为:

EPriorityAbsoluteVeryLow, EPriorityAbsoluteLow, EPriorityAbsoluteBackground, EPriorityAbsoluteForeground, EPriorityAbsoluteHigh.

相对优先级值为:

EPriorityMuchLess, EPriorityLess, EPriorityNormal, EPriorityMore, EPriorityMuchMore.

EPriorityNull 是一个特殊值,它定义了最低的级别,Kernel idel thread使用的就是它*_*

上一页  1 2 3 4 5 6 7 8  下一页

Tags:Symbian 操作系统 线程

编辑录入:coldstar [复制链接] [打 印]
赞助商链接