About Question com.enthuware.ets.scjp.v6.2.183 :

Help and support on OCA OCP Java Programmer Certification Questions
1Z0-808, 1Z0-809, 1Z0-815, 1Z0-816, 1Z0-817

Moderator: admin

Post Reply
piotrkmiotczyk
Posts: 27
Joined: Mon Sep 22, 2014 1:30 pm
Contact:

About Question com.enthuware.ets.scjp.v6.2.183 :

Post 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?

admin
Site Admin
Posts: 10388
Joined: Fri Sep 10, 2010 9:26 pm
Contact:

Re: About Question com.enthuware.ets.scjp.v6.2.183 :

Post 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.

Post Reply

Who is online

Users browsing this forum: Google [Bot] and 11 guests