Say I have singleThreadExecutor
and I 'give' it 10 tasks. Those tasks will be stored in BlockingQueue
and they will be executed one after another. So in Java we have 1 thread that will do task by task, until it does all 10.
My question is does that mean that given Java thread will be run on same CPU core all this time? Is there any promise in this situation?
One more thing. Could someone tell me does this have something to do that 1 Java thread is not equal to 1 CPU thread? Did I say it correctly? I can't find appropriate terminology for this, so any reference for this last thing could help :) I just remember I read something like this in the past..