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: 121 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.

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.