[mythtv] mythtranscode is niced, why not mythcommflag?

Chris Pinkham cpinkham at bc2va.org
Wed Apr 20 23:01:50 UTC 2005


> It seems they both ought to be able to have similar CPU consumption
> properties (which today is pretty simple).

mythcommflag handles nicing itself, so it doesn't need to JobQueue to
nice it.  The code is in programs/mythcommflag/main.cpp.  mythcommflag
runs at nice(17) if you are running at Medium or Low CPU usage and
if you are on Low, it also sleeps a little each frame to make sure
it gives up a lot of CPU time.  The sleep is necessary on slower
computers with software encoding, otherwise you migth see glitches in
the encoding.

So, this patch (while nice) isn't necessary. :)

> I am noticing that UserJobs have a more fine-grained nicing logic;
> they can nice 10 or 17 for "Medium" and "Low" CPU usage, but I'll make
> mythtranscode look like mythcommflag ...

This 3-level nicing logic (high/medium/low) is done because the JobQueue
can't guarantee that the user job will nice itself, so the JobQueue nices
the user job itself.

It would probably be good if they were all more similar, but the reason
I did the nicing inside mythcommflag is because it was originally created
to do manual flagging, so the JobQueue wasn't there to set the nice
level and rather than having the user required to nice the process, I
had mythcommflag do it automatically based upon the DB setting.

-- 
Chris



More information about the mythtv-dev mailing list