I am writing an application in java which involves parallel computing. My question is how can I explicitly assign threads to cores? What is the programming logic for it?
As said, the JVM won't let you. But first, you should ask yourself why you're thinking about assigning threads to cores. This is probably not what you want to do.
The Executor class is used to schedule medium-sized "grains" of computation without incurring the overhead of creating too many threads. You may also want to try using parallel branches for a much more fine-grained scheduling, here are some code samples: http://www.ateji.com/px/codesamples.html