Java servlets and multiple processors

B

Bura Tino

Hi,


Sorry if I'm posting to the wrong group. If I have a Java servlets
application running on a multiprocessor machine will the engine be
able to take advantage of that on its own or do I have to do something
to ensure that?

Thanks,

Bura
 
C

Chris Smith

Bura said:
Sorry if I'm posting to the wrong group. If I have a Java servlets
application running on a multiprocessor machine will the engine be
able to take advantage of that on its own or do I have to do something
to ensure that?

You'll gain that advantage automatically. Servlet-based applications
are inherently multithreaded.

--
www.designacourse.com
The Easiest Way to Train Anyone... Anywhere.

Chris Smith - Lead Software Developer/Technical Trainer
MindIQ Corporation
 
R

Roedy Green

Sorry if I'm posting to the wrong group. If I have a Java servlets
application running on a multiprocessor machine will the engine be
able to take advantage of that on its own or do I have to do something
to ensure that?

So long as your OS supports the dual processor, so will Java.

IIRC with some versions of Windows you have to do something special to
turn dual processor mode on and off. In some, it figures out
automatically on each boot.
 
B

Bura Tino

Chris Smith said:
You'll gain that advantage automatically. Servlet-based applications
are inherently multithreaded.

Thanks for this reply and the one by Roedy.

This has now become a pure java question. Is "multithreaded" enough to
take advantage of multiple processors? You don't need to be
"multi-processed"?
 
C

Christophe Vanfleteren

Bura said:
This has now become a pure java question. Is "multithreaded" enough to
take advantage of multiple processors?
Yes.

You don't need to be "multi-processed"?

No. Unless you're using an old Java implementation and use "green threads".
In that case, the java process itself manages your threads, but as far as
the kernel is concerned, there is only 1 thread.
 
B

Bura Tino

Christophe Vanfleteren said:
No. Unless you're using an old Java implementation and use "green threads".
In that case, the java process itself manages your threads, but as far as
the kernel is concerned, there is only 1 thread.
Thanks. Then (and this is almost not a java question) hypothetically
speaking, is it better to have a dual system 1ghz each and a single
processor 2ghz system. If the application is multithreaded and threads are
running at the same time, does it particularly matter whether it runs on a
single processor or not?

Bura
 
C

Christophe Vanfleteren

Bura said:
Thanks. Then (and this is almost not a java question) hypothetically
speaking, is it better to have a dual system 1ghz each and a single
processor 2ghz system. If the application is multithreaded and threads are
running at the same time, does it particularly matter whether it runs on a
single processor or not?

You can't answer this with a general yes/no for all cases. It depends on the
workload, OS kernel, wether a process is cpu or io driven, ...

But most of the time it is wrong to say that 2 1GHz cpu's will perform just
as good as a 2GHz one. They can get very close though in optimal
conditions.
 
M

Michael Borgwardt

Christophe said:
You can't answer this with a general yes/no for all cases. It depends on the
workload, OS kernel, wether a process is cpu or io driven, ...

But most of the time it is wrong to say that 2 1GHz cpu's will perform just
as good as a 2GHz one. They can get very close though in optimal
conditions.

They can also perform better, if the measure of performance is latency
instead of throughput.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top