[CUBE] PL 1.2 Shipping!

Arturo Pérez arturo at ethicist.net
Thu Feb 6 21:01:14 PST 2003


On Thursday, February 6, 2003, at 10:49  PM, Brooks Graham wrote:

>
> On Thursday, February 6, 2003, at 09:10 PM, Arturo Pérez wrote:
>>
>> In reality, even under OSX, no one codes multi-threaded apps except a 
>> few games and photoshop.  (Someone needs to keep a catalog of those). 
>>  In this case, the advantage of duals is that you can run 2 seriously 
>> CPU hogging apps at once.
>
> I'd like to submit a dissenting opinion.  (OS X-only.  I have no 
> experience with OS 1-9)
>
> In Unix, there are many processes running at the same time, no matter 
> what you're doing.  The display service, which shows up as "Window 
> Manager" in 'top', is a distinct process that gets its own scheduled 
> CPU allotment.  So, that said, even a single program/process that has 
> only a single thread, will benefit from a SMP (multi-processor) system 
> if it draws anything to the screen.

There's an "unless."  I don't know if Apple's window system lets 
applications write directly to the screen (X11 does not).  I think 3D 
games/OpenGL can.  In that case, unless the application is threaded the 
second processor doesn't help much.

>   "Window Manager" on my system has two active threads (at the 
> moment).  What I'm trying to say here is that Unix itself will utilize 
> multiple processors if they are present to schedule processes and 
> threads.  And there's *always* something that needs CPU time.  Maybe 
> not a lot of CPU time, but the more CPUs you have, the more that can 
> happen in parallel.

Actually, you've hit the nail on the head.  That is the #1 reason (to 
me) for having a dual.  It will make the "user experience" MUCH 
smoother.

>
> So, under OS X, you don't need "special applications" that are coded 
> to be "SMP-aware" to benefit from multiple processors.  All programs 
> under OS X can and will benefit from SMP.

Well, it depends on what you mean by "benefit" but sure.

> Notice that the top line shows "129 threads"  but what interests me 
> more is looking at specific apps here:
>
> Dreamweaver has 5 threads.  (column "#TH") Lot's of opportunity for 
> parallelism
> Mail has 5 as well.
> and so on.
>
It depends on what those threads are doing.  Recently I read a 
discussion saying that all OSX apps have two threads:  one for sound 
and one for UI.  If that is true, unless you're musically inclined, the 
second processor is not helping.  Another issue is that threads are 
often used to support asynchronous I/O (like network communication).  
In that case the threads don't ever help because you're really waiting 
for the disk or network.

A better way of figuring how much a second processor will help is to 
use ps instead of top.  What matters is whether you consistently have 
more than one process in the "runnable" state.  That means it's waiting 
for the CPU (or has the CPU; i.e. actually running).  That's denoted by 
the R under the STAT column when you do a
	ps -aux

On a single processor you'll usually see that only the ps is in the R 
state.

Hopefully we're not boring the rest of you to death.



More information about the Cube mailing list