Page 1 of 1
About Question com.enthuware.ets.scjp.v6.2.183 :
Posted: Tue Oct 21, 2014 6:37 am
by piotrkmiotczyk
I know the OS decides when it starts but isn't it the thread's run method implementation which usually decides for how much time it runs?
Re: About Question com.enthuware.ets.scjp.v6.2.183 :
Posted: Tue Oct 21, 2014 9:35 am
by admin
No, actually, the programmer's code decides when a thread is started (when you call its start method) but only the JVM can decide how long and when a thread will actually get to run (before the thread's run method terminates, of course).
In other words, JVM cannot automatically start a thread and a programmer cannot tell when a thread will actually run.
HTH,
Paul.