balancing threads on dual-core CPU

Hi,i am running a Linux SMP kernel and working with a single thread java program, that could be written for more than one threads. Would that automagically mean, that these threads would be (equally?) shared among the 2 CPUs?Thanks
[252 byte] By [uiga] at [2007-11-27 8:35:48]
# 1
Yes and no.Proper multithreaded code can run on multiple processors.What will actually happen is harder to say. It depends on the VM, implementation and possibly configuration and it depends on the OS and it depends on the hardware.
cotton.ma at 2007-7-12 20:32:29 > top of Java-index,Java Essentials,Java Programming...
# 2
And it depends what else is running on the computer at the time as well. Modern OSes always have a lot of stuff running.
jschella at 2007-7-12 20:32:29 > top of Java-index,Java Essentials,Java Programming...
# 3
A link maybe to Linux+Java+Multithreading+Balancing or something? I searched, but found many irrelevant stuff.
uiga at 2007-7-12 20:32:29 > top of Java-index,Java Essentials,Java Programming...
# 4

> A link maybe to Linux+Java+Multithreading+Balancing

> or something? I searched, but found many irrelevant

> stuff.

I don't know what you are looking for. You asked a question, we answered it. Are you looking for some more specific information? If so it would help me to know what.

cotton.ma at 2007-7-12 20:32:29 > top of Java-index,Java Essentials,Java Programming...
# 5
I am interesting to know how i could write some "good" multithreaded code, that will fully take advantage the capabilities of my system
uiga at 2007-7-12 20:32:29 > top of Java-index,Java Essentials,Java Programming...
# 6

Have you seen this?

http://java.sun.com/docs/books/tutorial/essential/concurrency/index.html

And this http://java.sun.com/developer/technicalArticles/Programming/JVMPerf/

This last one is old but still useful in general and it has links towards the end that might also be of interest.

cotton.ma at 2007-7-12 20:32:29 > top of Java-index,Java Essentials,Java Programming...