Per-worker deque

Each worker has its own double-ended queue. Owner pushes/pops from head. LIFO for cache locality.

Advertisement

Per-worker deque

Each worker has its own double-ended queue. Owner pushes/pops from head. LIFO for cache locality.

Advertisement

Idle → steal

Worker with empty deque steals from TAIL of another. FIFO steal minimizes contention with owner's LIFO pop.

Fork = enqueue

fork() pushes subtask to worker's own deque. join() works stolen tasks if possible instead of blocking.

Common pool default

ForkJoinPool.commonPool() = default parallelism = CPU count - 1. Used by parallel streams. Shared — don't block!

Blocking I/O breaks it

Never block on I/O in fork/join workers — steals stop working. Use ManagedBlocker if you must.