How does Fork/Join work, and where does ManagedBlocker come in? We interviewed concurrency expert Heinz Kabutz at Voxxed Days CERN.

Turbo Charge CPU Utilization in Fork/Join Using the ManagedBlocker

Fork/Join is a framework for parallelizing calculations using recursive decomposition, also called divide and conquer. These algorithms occasionally end up duplicating work, especially at the beginning of the run. We can reduce wasted CPU cycles by implementing a reserved caching scheme. Before a task starts its calculation, it tries to reserve an entry in the shared map. If it is successful, it immediately begins. If not, it blocks until the other thread has finished its calculation. Unfortunately this might result in a significant number of blocked threads, decreasing CPU utilization. In this talk we will demonstrate this issue and offer a solution in the form of the ManagedBlocker. Combined with the Fork/Join, it can keep parallelism at the desired level.

Dr Heinz Kabutz writes the popular “The Java Specialists’ Newsletter” read by tens of thousands of enthusiastic fans in over 138 countries.

Fork/Join Using the ManagedBlocker – Heinz Kabutz

Profile photo of Katharine
About The Author
- Katharine is a Java developer by trade, turned Community & Content Manager for Voxxed. Helping developers learn and share knowledge. Contact me at kbe@voxxed.com with any news, articles or tutorials.