• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Pthread Priority
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Pthread Priority


  • Subject: Re: Pthread Priority
  • From: "Bill Lowrey" <email@hidden>
  • Date: Wed, 20 Aug 2008 13:33:09 -0500

Hi,

That's interesting advice. If I recall correctly, SCHED_RR requires root on Linux (or, at least it used to). Is that the case on the Mac?

If not, it is actually closer to the behavior that I want in my app and I'd like to use it. My pthreads wrapper was initially written for Linux, and used SCHED_OTHER to avoid the root requirement. That has been a number of years ago.

Bill

On Wed, Aug 20, 2008 at 5:42 AM, Luca Ciciriello <email@hidden> wrote:

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, &param );
> ...
> ...
>
>
> 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

 _______________________________________________
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

References: 
 >Pthread Priority (From: Romain Marucchi <email@hidden>)
 >RE: Pthread Priority (From: Luca Ciciriello <email@hidden>)

  • Prev by Date: Re: Unable to read symbols for...
  • Next by Date: Re: Unable to read symbols for...
  • Previous by thread: RE: Pthread Priority
  • Next by thread: Re: Pthread Priority
  • Index(es):
    • Date
    • Thread