On Tue, 4 Jul 2000, Geoff Canyon wrote:

> Scott Raney <[EMAIL PROTECTED]> said, on 7/4/00 10:11 AM:
> 
> >like any good OS, NT
> >punishes processes when they seem to be sucking up CPU time for no
> >good reason, something QT does a lot
> 
> I'm just curious, how does QT suck up CPU time for no good reason, and 
> how can the OS tell the difference between real work and makework? I'm 
> not being sarcastic, I'm just curious--presumably QT isn't issuing 
> endless strings of NOPs, so how could NT, or any OS, watch what QT, or 
> any program, was doing and say, "that program isn't doing anything 
> useful--it's just shuffling those same chunks of data back and forth 
> repeatedly. And that sort algorithm could have been written much more 
> efficiently; I'll punish it!"

It's not so smart as that, it just does something simple like measure
the percentage of its allotted CPU time a process uses between calls
it makes to the OS (at which point the process does the equivalent of
the Roberts Rules "I yield the balance of my time to whoever's next").
If it always uses up its full quota, the OS will compensate by giving
it smaller time slices or giving it slices less often to ensure that
other programs running on the system remain responsive.

QT gets penalized for two reasons: 1) it bypasses the OS whenever it
can (which may explain why forcing it to use GDI calls makes it work
better on NT because this ties it closer to the OS) and 2) it starts
its own thread that does stuff like polling the main event queue
instead of doing it the nice way by just waiting for an event.  To
some extent both of these practices are justified for a time-critical
library like QT.  But Apple's got some tuning to do to make it work
better on NT (and probably on UNIX, at least in its Mac OS X guise)
where the rules are different than on single-user systems like MacOS
and Windows 95/98.

Another thing that might be worth trying would be to change the
"performance boost for the foreground application" slider in the
system control panel.  I'm just speculating, but this may be a way to
make NT go a little easier on the punishment it dishes out to CPU hogs
like QT ;-)
  Regards,
    Scott

> Geoff "striving to learn more than his due about modern OSes" Canyon

********************************************************
Scott Raney  [EMAIL PROTECTED]  http://www.metacard.com
MetaCard: You know, there's an easier way to do that...


Archives: http://www.mail-archive.com/metacard%40lists.best.com/
Info: http://www.xworlds.com/metacard/mailinglist.htm
Please send bug reports to <[EMAIL PROTECTED]>, not this list.

Reply via email to