[haiku-development] Re: Scheduler algorithm improvements

  • From: Stephan Assmus <superstippi@xxxxxx>
  • To: haiku-development@xxxxxxxxxxxxx
  • Date: Sun, 15 Nov 2009 12:09:42 +0100

Hi,

On 2009-11-09 at 16:32:41 [+0100], Axel Dörfler <axeld@xxxxxxxxxxxxxxxx> 
wrote:
> Mikhail Panasyuk <otoko@xxxxxxxxx> wrote:
> > - MediaPlayer:
> > 1. media extractor thread
> > 2. event queue runner
> > 3. playback manager
> 
> I haven't changed those either, since I guess Stippi (or someone else) 
> will have a better understanding about which thread should get a higher 
> priority and why.

Slowly catching up on my mails... Very interesting read, nice research, 
Mikhail! These threads you mention above should indeed get a higher 
priority. Event queue runner and playback manager are timing threads. The 
Extractor thread should, IMHO, not really be so important, but what I 
noticed is that many media readers work with *very* small read-buffers. You 
can see this with the MP3 reader for example, if you playback an MP3, you 
can see te harddrive LED flash all the time, because it reads so tiny 
chunks. I don't really see the philosophy behind this, maybe Marcus can 
explain. The "ChunkReader" is supposed to read chunks from media files 
ahead. It does a read-ahead of four chunks in advance, if memory serves. 
Additionally, MediaPlayer does it's own read-ahead buffering for audio, 
always up to the next seekable audio keyframe/chunk. In any case, that 
giving the media extractor thread a higher priority helps may just help a 
symptom of using too small buffers in the first place.

Best regards,
-Stephan


Other related posts: