Marko van der Puil wrote:
 
> so httpd 1 has just queried the database and httpd 2 is just executing...
> It also has to query the database, so it has to wait, for httpd 1 to finish. (not
> actually how it works but close enough)
> Now httpd 1 has the results from the query and is preparing to read the template
> from disk.
> httpd 2 is now quering the database... Now httpd 1 has to wait for the httpd 2
> query to finish, before it can fetch it's template from disk. a.s.o. a.s.o. This,
> unfortunately is (still) how pc's work. There's no such thing as paralel processing
> in PC architecture.
> This example is highly simplyfied. In practise it is a lot worse than I demonstrate
> here, because while waiting for the database query to finish, your application
> still gets it's share of resources (CPU) so while the load on the machine is over
> 1.00 it's actually doing nothing for half the time... :( This is true, take a
> university course in information technology if ya want to know...

It would be overly difficult for me to address every falsehood in that
paragraph, so I will summarize by saying that I've never seen more
psuedo-technical bullshit concentrated in one place before.

I will address two points:

There is a very high degree of parallelism in modern PC architecture. 
The I/O hardware is helpful here.  The machine can do many things while
a SCSI subsystem is processing a command, or the network hardware is
writing a buffer over the wire.

If a process is not runnable (that is, it is blocked waiting for I/O or
similar), it is not using significant CPU time.  The only CPU time that
will be required to maintain a blocked process is the time it takes for
the operating system's scheduler to look at the process, decide that it
is still not runnable, and move on to the next process in the list. 
This is hardly any time at all.  In your example, if you have two
processes and one of them is blocked on I/O and the other is CPU bound,
the blocked process is getting 0% CPU time, the runnable process is
getting 99.9% CPU time, and the kernel scheduler is using the remainder.

-jwb

Reply via email to