On Sat, 2003-09-20 at 09:04, Eric Huff wrote:
> > > Paralleling obviously works great for human interaction (one web
> > > page loading while reading another).  But if the processes are using
> > > up all the cpu, paralleling shouldn't help unless there is a piece
> > > of hardware/peripheral it's waiting for, right?
> > > 
> > 
> > once the kernel's up, you've got a multi-tasking OS at hand. No matter
> > how busy a given process is, there's resource for others; otherwise,
> > your computer would lock up every time a process hangs.
> 
> But if that is true, doesn't that mean that there's unused cpu ?  If
> it's using 99% of the cpu, and then another process starts in parallel,
> they probably each get 49% of the cpu, with a little left over for
> safety.  (just picking arbitrary numbers).  Is that right?
> 
> Just trying to understand this better...

not really... first, we must define what busy is :-) I have an impatient
daughter standing at my elbow so I'll make this quick. Processes aren't
always bottlenecked by CPU, and the well behaved ones will let go of CPU
when they're waiting on something else. Say that it's a database startup
-- program comes up, reads config, makes sure that all is cool, then
starts the process of opening disk files. For the next few jiffies, it's
basically waiting on the disk bus and doesn't need the CPU, so it's only
using 2 or 3 percent.

When a program uses 99% of CPU, one of two things is happening -- it
intends to do so (think setiathome or cpuburn) or it's buggy. In those
cases, the kernel tells it it's getting all the CPU, but it in fact
still accepts requests for CPU cycles from other programs and inserts
them ahead of the greedy program. This is why if you watch top while
setiathome is running or wine is crashing :-) You'll see top and the
greedy program vying for the top spot.
-- 
Jack Coates
Monkeynoodle: A Scientific Venture...


Want to buy your Pack or Services from MandrakeSoft? 
Go to http://www.mandrakestore.com

Reply via email to