Chris Price wrote:
> Jean-Luc Rochat wrote:
> >
> > Frank Morton wrote:
> >
> > > Is anyone running jserv/apache with a dual
> > > processor system? Is there any difficulty
> > > doing so?
> > >
> >
> > Yes I am. No, no problem . It's better to use JVM with native threads
> > (vs green threads) in order to get benefits from all the processors.
>
> OK, correct me if I am wrong but;
>
> 1)AFAIK, The JVM itself is not a threaded program.
false. A program able to spawn some threads is multithreaded.
> So when it runs on a multiprocessor system, it still runs as one
> process.
true- only one pid.
> For example, if a thread makes a call to memory, that thread's request
> is received by the non-threaded JVM and subsequently sent to the OS's
> memory manager.
No, the call is catched by the OS kernel.
> Granted that the JVM process is capable of running multiple threads at
> the same time very efficiently.
In fact all depends of the underlying libraries used for threads. (native vs green
threads). If the system is MT (like Solaris),
a native threads library permits to use preemptive sceduling (OS managed). If
using green threads, the JVM has its own scheduler, and is not preemptive (in fact
it could be). (that's how ADA threads worked on top of DOS).
> A single 'monolithic' process (ie: not threaded) has no direct
> performance advantages on an SMP system. Indirect advantages are derived
> from the fact that other processes on the system can use the other
> processor(s) in the SMP system as they become free (OS dependant).
false for native threads (the OS could distribute 64 threads on 64 processors),
but sure true for green threads (one process and one thread at a time). That's why
Java needs Multi-threaded systems.
> Also AFAIK, most common OS'es in use today are not trully
> multi-threaded. NT, Linux, Solaris all can take advantage of multiple
> processors, but are still processed-based and not thread-based in their
> approach to programs running on them.
false. Solaris, by example uses a thread implementation based on Light Weight
Processes (lwp), and is able to distribute
1 process -> N thrhreads -> M lwp-> P processors. So Solaris is able to run at the
same time 2 threads from the same process (same pid), on 2 CPUs.
Linux's threads implementation is nearly true threads, as NT.
> Not before you get out your flamethrowers, please note the TWO 'AFAIK'
> references above.
Boom , Sorry, too late ...;-)
> I am a 4th year comp sci student, and I am basing my
> opinions on my schooling and self reading. I have a dual PPRO system at
> home running Linux (2.2.x kernel) and Windows NT. When I start a JVM on
> either, it shows up in teh process list as a SINGLE process.
>
> SUMMARY
> So even if your Java program is threaded, the bottleneck is still the
> single-process JVM, reducing your gain on SMP systems from threading to
> none. Optimization of many threads within the JVM itself is quite good
> from what I have read.
Hope this helped you to understand the MT OSes benefits.
Jean-Luc
----------------------------------------------------------------
To subscribe: [EMAIL PROTECTED]
To unsubscribe: [EMAIL PROTECTED]
Archives and Other: <http://java.apache.org/main/mail.html/>
Problems?: [EMAIL PROTECTED]