RE: Pthread Priority
RE: Pthread Priority
- Subject: RE: Pthread Priority
- From: Luca Ciciriello <email@hidden>
- Date: Wed, 20 Aug 2008 11:42:56 +0100
- Importance: Normal
Use the posix functions sched_get_priority_max(SCHED_OTHER); and sched_get_priority_min(SCHED_OTHER); to get the max and the min value supported by your system and then work within those values. Consider that on LINUX the priority max is 0, that is the min priority on MAC. Further I suggest to you to use on MAC the policy SCHED_RR.
Luca.
________________________________
> From: email@hidden
> To: email@hidden
> Date: Wed, 20 Aug 2008 16:01:51 +0800
> Subject: Pthread Priority
>
> Im porting a Linux app to the Mac and have the following code to set my thread priority? The results are not as expected Im I missing something?
>
>
> ...
> ...
> struct sched_param param;
> int policy = SCHED_OTHER;
>
>
> priority = VERY_HIGH;
>
>
> param.sched_priority = priority;
> pthread_setschedparam( pthread_self(), policy, ¶m );
> ...
> ...
>
>
> And I got the following def. for my priorities:
>
> VERY_LOW = 10,
> LOW = 5,
> NORMAL = 0,
> HIGH = -5,
> HIGH = -10
_________________________________________________________________
Make a mini you on Windows Live Messenger!
http://clk.atdmt.com/UKM/go/107571437/direct/01/ _______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden