About Question enthuware.ocpjp.v7.2.1257 :

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

Moderator: admin

Post Reply
homeric
Posts: 6
Joined: Sun Mar 13, 2016 1:34 am
Contact:

About Question enthuware.ocpjp.v7.2.1257 :

Post by homeric »

Please explain the options in a more elaborate manner.

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

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

Post by admin »

Can you tell me explanation to which option is not clear so that we can explain better?
Also, which book are you following?
Paul.

homeric
Posts: 6
Joined: Sun Mar 13, 2016 1:34 am
Contact:

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

Post by homeric »

Please elaborate the first option. I am following the K&B book.

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

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

Post by admin »

The first option is just a statement of a fact from the JavaDoc API description given here: https://docs.oracle.com/javase/8/docs/a ... JoinPool--

The thread factory is explained here: https://docs.oracle.com/javase/8/docs/a ... ctory.html

All this means is that instead of directly doing new Thread to create threads, the responsibility to create threads is passed on to a thread factory. The thread factory may internally create a new thread or supply a existing one based on its policy.

HTH,
Paul.

mayilb77@gmail.com
Posts: 1
Joined: Wed Jul 08, 2020 4:19 pm
Contact:

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

Post by mayilb77@gmail.com »

Pls can you explain fifth option ?

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

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

Post by admin »

The fifth option is, "The tasks submitted to a ForkJoinPool sit on the leaves of the task tree." This option was seen by our content author on their actual exam (long time back) and so we added it here.

To be honest, I am not exactly sure what was the thought process behind this option but here is what it seems to be referring to:

While using the fork/join framework, conceptually, a big task is split into multiple subtasks, which themselves may be split further into sub-subtasks and so on. This generates the "task tree". The last level of the tree (i.e. the leaf nodes) comprise of tasks that are computed (instead of splitting further).

Implementation wise, however, the actual task tree generated could be a little different because of work stealing approach where other threads may steal any node of task tree. So, it is possible that the smallest piece of a task may not be the leaf node of the tree. It depends on the implementation of the framework.

You may want to go through this article for a more detailed discussion on this: http://moi.vonos.net/java/forkjoin/

Post Reply

Who is online

Users browsing this forum: Bing [Bot], tequilaa and 8 guests