About Question enthuware.ocpjp.v7.2.1324 :

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

Moderator: admin

Post Reply
tduglas
Posts: 6
Joined: Wed May 22, 2013 4:03 am
Contact:

About Question enthuware.ocpjp.v7.2.1324 :

Post by tduglas »

Why not changing " Thread.sleep(10000); //1  sleep for 10 secs" to  Thread.sleep(1000); //1  sleep for 1 secs?
As for now the answer is not earnestly. Both threads have equal priority and so both will compete equally on the cpu time. If not take into consideration the proliferation of operation system schedulers it would be more fair to make Thread.sleep(1000) in both threads.

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

Re: About Question enthuware.ocpjp.v7.2.1324 :

Post by admin »

You are right. 10 seconds is there to confuse you. The point that it is trying to make is that you should not depend on which thread executes when. You should not depend on thread scheduling based on sleep either.

HTH,
Paul.
If you like our products and services, please help us by posting your review here.

Post Reply

Who is online

Users browsing this forum: No registered users and 230 guests