Nathan Meyers wrote:
> 
> > I'm curious about this as well.  I've been playing around with the JDK
> > 1.2-pre2 on my spanking new Dual-PII machine recently to see how well it
> > handles SMP and I've noticed that with either native or green threads,
> > it only seems to use a single CPU for running Java apps.  I've noticed
> > this same behaviour in 1.1.7v3, so I'm not 100% sure I'm not just doing
> > something wrong like not setting some env var to tell the JDK to use
> > multi CPUs.
> 
> A look at the process list shows that the native-threads version is
> definitely creating multiple threads. (Linux threads get their own
> process table entries; if you don't see multiple ps entries, you're
> either running green threads or have some degenerate libpthreads that
> implements the API in user space.)
>
> I would think, given the clear presence of multiple threads, that
> assignment to CPUs is out of the JVM's hands. Assuming you really do
> have multiple threads concurrently consuming CPU time, failure to engage
> multiple CPUs sounds like something broken in the OS. Obvious dumb
> question: you are running the SMP kernel, yes?

Several entries do show up in the process table when using the native
thread version of the JDK, and I agree that once the JDK asks the OS to
create threads, it's in the hands of the OS, which is why it puzzles me
that load meters only show 50% load on a dual-processor machine when
running native-thread JDK and multithreaded Java apps and why I was
hoping that I was just missing some command-line switch or something.

And yes, I am running an SMP kernel.  I can easily make the system reach
100% load if I run several apps simultaneously.  I am, of course,
assuming that monitors are accurate, but since they report the expected
results under different loads, I suspect they are.  (i.e. they show ~50%
usage when running a single CPU-intensive app, ~100% usage when running
two CPU-intensive apps, when one of those apps finishes ahead of the
other, the usage drops back down to ~50%, etc....)

The machine is a glibc2.0 based machine running kernel 2.2.10 with all
the appropriate package upgrades from all the older 2.0-based apps to
the ones built for the 2.2 kernels.  I'm using the glibc2.0-compiled JDK
1.2-pre2 as well.
 
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
With Microsoft products, failure is not           Derek Glidden
an option - it's a standard component.      http://3dlinux.org/
Choose your life.  Choose your            http://www.tbcpc.org/
future.  Choose Linux.              http://www.illusionary.com/


----------------------------------------------------------------------
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to