You are viewing this site as a guest. Join our community to get your questions answered and share knowledge. Active members may advertise and ask for a website critique.

Does java respect multi-core processors?

They have: 18 posts

Joined: Jan 2009

Hi all.

Does anyone know whether java uses more than one core? For example, if I have Tomcat running on say a quad core cpu and my application spawns four new threads, will each thread run on it's own core? Or, will they all run on the core that's running Tomcat?

If this was the case, it would imply that there is no point buying multi-core servers for java web apps.?!

They have: 112 posts

Joined: Dec 2008

If the server you are using is able to spawn threads and processes (which tomcat is), it is the operating system's job to schedule those threads and tasks to the different processors. Most modern unix and windows offerings handle scheduling at least four processors quite nicely.

Cheers,
Shaggy.