Derek Glidden wrote:
>
> 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.
OK... so one other question you haven't answered. Are you sure you've
got two threads staying busy? Most of Java's threads spend most of their
time sitting around and waiting. If you've really got two threads
spinning and you're not seeing 100% load, something's strange -- and
it's not a command-line switch.
Nathan
----------------------------------------------------------------------
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]