Question asked on CyclicBarrier.
But this is not in Java8 upgrade course .
How this question came in simulator provided by you ?
About Question enthuware.ocpjp.v8.2.1761 :
Moderators: Site Manager, fjwalraven
-
- Posts: 9
- Joined: Wed Nov 25, 2015 11:54 pm
- Contact:
-
- Site Admin
- Posts: 10388
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.ocpjp.v8.2.1761 :
It is there because some test takers reported getting a question on it.
-
- Posts: 49
- Joined: Mon Jul 27, 2015 4:34 am
- Contact:
Re: About Question enthuware.ocpjp.v8.2.1761 :
CyclicBarrier is actually listed in the official exam topic list
-
- Posts: 54
- Joined: Thu Mar 03, 2016 1:26 pm
- Contact:
Re: About Question enthuware.ocpjp.v8.2.1761 :
The question says:
The option below is also correct:
Both the first and the second answers ensure that the run() methods of ItemProcessor and Merger are executed.What should be inserted in the following code such that run methods of ItemProcessor as well Merger will be executed?
The option below is also correct:
This is pretty useless as a CyclicBarrier, I know, as it lets every thread pass through it without any of them waiting, but it executes the merger's run() method every time cb.await() is called. Since no threads are held, when ip.start() is called, the ItemProcessor's run() method also executes normally.Make ItemProcessor extend Thread instead of implementing Runnable and add CyclicBarrier cb = new CyclicBarrier(1, m); to //LINE 3
-
- Site Admin
- Posts: 10388
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.ocpjp.v8.2.1761 :
Yes, you are right. Option 1 will let merger's run execute, but twice. The problem statement has now been updated to make the intention of the question clear.
thank you for your feedback!
Paul.
thank you for your feedback!
Paul.
Who is online
Users browsing this forum: No registered users and 5 guests