Possible Duplicate:
Java thread affinity
I would like to test my 2-thread program running each thread on its own physical processor. I heard in linux you can PIN a thread to a certain processor so it stays there. Is there some kind of library in Java (using native code of course) that would allow me to do that? If not, can a Linux guru describe how do I pause my JVM, list my Java threads, get their native id and run some kind of linux command to PIN them? Then I can resume my JVM and the threads will bind to their assigned processor.