This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.concurrent.CountDownLatch; | |
import java.util.concurrent.ForkJoinPool; | |
import java.util.concurrent.RecursiveAction; | |
/** | |
* This example uses a Parent task (e.g. mapping in a custom Map when the Map is full) that will | |
* launch * a Child task (e.g. to resize the Map, we need to rehash it). Any new Parent task needs | |
* to wait for the Child task to finish. The Child task will also launch Child tasks. | |
* | |
* The idea is that, a thread B in a child task C0 `join`s a child task C2 and manages to steal a |