[CUBE] PL 1.2 Shipping!

Brooks Graham brooksgraham at mac.com
Thu Feb 6 19:49:10 PST 2003


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.  "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.

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.

Here's output from 'top' on my Cube:

(sorry if your mailreader does something funky with the font. a 
fixed-width font will make it look right)

[the command is: top -u -s 10 ]

Processes:  61 total, 2 running, 59 sleeping... 129 threads            
21:24:22
Load Avg:  0.25, 0.43, 0.31     CPU usage:  20.4% user, 6.1% sys, 73.5% 
idle
SharedLibs: num =  127, resident = 35.8M code, 3.23M data, 10.2M 
LinkEdit
MemRegions: num = 4215, resident = 72.0M + 10.4M private,  121M shared
PhysMem:   105M wired,  246M active,  757M inactive, 1.08G used,  173M 
free
VM: 1.95G + 75.6M   21764(0) pageins, 2200(0) pageouts

   PID COMMAND      %CPU   TIME   #TH #PRTS #MREGS RPRVT  RSHRD  RSIZE  
VSIZE
  2087 Dreamweave  10.5%  0:21.70   5    80   470  28.4M  39.8M  48.9M   
133M
  2050 Mail         6.6%  1:45.69   5   147   237  8.20M+ 20.1M  14.1M+ 
83.9M
  1998 Window Man   5.1%  8:40.58   2   225   318  6.79M+ 32.8M- 37.7M+ 
76.9M+
   179 ATSServer    1.1% 21:17.49   2    56   186   880K  8.25M  4.89M  
49.2M
  2027 top          0.8%  3:31.06   1    14    18   252K   380K   352K  
13.6M
     0 kernel_tas   0.7% 43:26.25  26     0     -      -      -  89.3M-  
520M-
  2013 Nikon View   0.5%  1:27.72   1    47    86   616K  6.64M  2.24M  
59.8M
  2024 Terminal     0.3%  0:51.64   3    61   172  1.26M+ 11.5M  6.04M  
67.1M
  2006 Dock         0.1%  0:12.67   2   101   149  1.52M  15.4M  9.56M+ 
70.7M
  1544 RetroRun     0.0%  0:27.83   1    11    25   256K  1.90M   108K  
15.1M
  2016 MagicMenuH   0.0%  0:00.60   1    41    75   432K  2.36M  1.43M  
53.1M
   350 cupsd        0.0%  1:14.20   1     8    68  1.64M   808K  2.20M  
4.44M
    71 update       0.0%  0:59.98   1     7    13    48K   344K   104K  
1.26M
   110 configd      0.0%  0:43.06   3   113   135   472K  1.22M  1.55M  
15.9M
   431 slpd         0.0%  0:34.16   8    51    31   192K   548K   604K  
17.8M
[Cube:~] brooks%

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.

Now here's a disclaimer:  my knowledge of Unix internals is very deep 
for Solaris and HP-UX (both of the AT&T SystemV flavor) but I'm 
assuming that the NeXTstep, er, um, OS X scheduler is similar.  But 
then again, you know what happens when you assume ... ;-)

HTH

-brooks


More information about the Cube mailing list