[haiku-development] Re: Interesting thread priority assignments in media kit

  • From: "François Revol" <revol@xxxxxxx>
  • To: haiku-development@xxxxxxxxxxxxx
  • Date: Tue, 05 Aug 2008 01:35:05 +0200 CEST

> 2008/8/5 Axel Dörfler <axeld@xxxxxxxxxxxxxxxx>:
> > "Rene Gollent" <anevilyak@xxxxxxxxx> wrote:
> >> I guess I was remembering wrong, the closest would be
> >> B_URGENT_PRIORITY and that one is 110. B_REAL_TIME_PRIORITY is
> > > indeed
> >> 120 which is the value I was seeing. Does BeOS use priorities that
> >> high as well for the media threads? That seems dangerous since it
> >> would pretty much cause the whole sys to grind to a halt if
> > > something
> >> goes wrong in some media-related task.
> >
> > That's the basic idea behind realtime threads: they have to be
> > designed
> > in a way that nothing can go wrong :-)
>
> We need to think very carefully about thread priorities.  Tasks that
> use a lot of CPU should not normally be given a high priority.
>
> High priority should be reserved for those tasks that do their work
> very quickly and/or are interacting with hardware that has hard
> limits
> on timing.
>
> Decoding Video or Audio is not a high priority task.  If your CPU is
> not up to the task of decoding at the rate required then raising the
> priority is unlikely to help.

That's exactly why reading and decoding are done in separate threads
with lower priority than mixing and playback to hardware.

François.

Other related posts: