aspose file tools*
The moose likes Beginning Java and the fly likes Practice Exam I: question 1 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Practice Exam I: question 1" Watch "Practice Exam I: question 1" New topic
Author

Practice Exam I: question 1

henry joe
Ranch Hand

Joined: Jul 24, 2012
Posts: 32
Hello the answer given to the code below says that Bang will execute for a second or two and It's difficult to predict which thread will be the last to finish. My question is how did they come to such conclusions from the code below? I had thought that it will execute for around 2 and half seconds ..



I just need explanations on why it is difficult to predict which thread and also the time factor in threads. Thanks
Henry Wong
author
Sheriff

Joined: Sep 28, 2004
Posts: 18712
    
  40


Please QuoteYourSources.

Henry


Books: Java Threads, 3rd Edition, Jini in a Nutshell, and Java Gems (contributor)
henry joe
Ranch Hand

Joined: Jul 24, 2012
Posts: 32
OCP Java Practice Exam textbook ; Practice Exam I question 1
LQ McDonald III
Greenhorn

Joined: Aug 01, 2012
Posts: 10

Well...it could be because java does not explicitly enforce thread scheduling in any specific manner and lacks a thread scheduler. Thread scheduling in Java is platform dependent and relies on your JVM implementation.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Practice Exam I: question 1