Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Since nobody else seems to understand my question I try to explain what I found after some nights of debugging:</p> <p>The current implementation of ForkJoinTasks works well if all fork/join calls are strictly paired. Illustrating a fork by an opening bracket and join by a closing one a perfect binary fork join pattern may look like this: </p> <p><strong>{([][]) ([][])} {([][]) ([][])}</strong></p> <p>If you use invokeAll() you may also submit list of subtasks like this: </p> <p><strong>{([][][][]) ([][][][]) ([][][][])}</strong></p> <p>What I did however looks like this pattern: </p> <p><strong>{([) ([)} ... ]]</strong></p> <p>You may argue this looks ill or is a misuse of the fork-join framework. But the only constraint is, that <a href="http://docs.oracle.com/javase/7/docs/api/java/util/concurrent/ForkJoinTask.html" rel="nofollow">the tasks completion dependencies are acyclic</a>, else you may run into a deadlock. As long as my <strong>[]</strong> tasks are not dependent on the <strong>()</strong> tasks, I don't see any problem with it. The offending <strong>]]</strong>'s just express that I do not wait for them explicitly; they may finish some day, it does not matter to me (at that point).</p> <p>Indeed the current implementation is able to execute my interlocked tasks, but only by spawning additional helper threads which is quite inefficient.</p> <p>The flaw seems to be the current implementation of join(): joining an <strong>)</strong> expects to see its corresponding <strong>(</strong> on top of its execution queue, but it finds a <strong>[</strong> and is perplexed. Instead of simply executing <strong>[]</strong> to get rid of it, the current thread suspends (calling wait()) until someone else comes around to execute the unexpected task. This causes a drastic performance break down.</p> <p>My primary intend was to put additional work onto the queue to prevent the worker thread from suspending if the queue runs empty. Unfortunately the opposite happens :-( </p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload