aspose file tools*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Marcus Mock Exam No.2 Question 24 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Marcus Mock Exam No.2 Question 24" Watch "Marcus Mock Exam No.2 Question 24" New topic
Author

Marcus Mock Exam No.2 Question 24

John Fairbairn
Ranch Hand

Joined: Jul 12, 2000
Posts: 31
Why is option 3 not a valid answer? The only valid answer given is 1.
Under what circumstances might you use the yield method of the Thread class?
1) To call from the currently running thread to allow another thread of the same priority to run
2)To call on a waiting thread to allow it to run
3) To allow a thread of higher priority to run
4)To call from the currently running thread with a parameter designating which thread should be allowed to run
Thanks in advance
Marcus Green
arch rival
Rancher

Joined: Sep 14, 1999
Posts: 2813
According to the answer given on that page
1) To call from the currently running thread to allow another thread of the same or higher priority to run
Option 3 looks plausible but there is no guarantee that the thread that grabs the cpu time will be of a higher priority. It willdepend on the threading algorithm of the Java Virtual Machine and the underlying operating system

SCWCD: Online Course, 50,000+ words and 200+ questions
http://www.examulator.com/moodle/course/view.php?id=5&topic=all
John Fairbairn
Ranch Hand

Joined: Jul 12, 2000
Posts: 31
If the thread which will be allocated CPU time is dependent on
the threading algorithm of the JVM and the underlying operating system, then what is the guarantee that a thread of the SAME priority will run let alone a HIGHER priority?
Then question 1 would have to be subject to review:
(1)To call from the currently running thread to allow another thread of the same priority to run
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Marcus Mock Exam No.2 Question 24