Java’s Fork/Join vs ExecutorService – when to use which?

Fork-join allows you to easily execute divide and conquer jobs, which have to be implemented manually if you want to execute it in ExecutorService. In practice ExecutorService is usually used to process many independent requests (aka transaction) concurrently, and fork-join when you want to accelerate one coherent job.

Why does parallel stream with lambda in static initializer cause a deadlock?

I found a bug report of a very similar case (JDK-8143380) which was closed as “Not an Issue” by Stuart Marks: This is a class initialization deadlock. The test program’s main thread executes the class static initializer, which sets the initialization in-progress flag for the class; this flag remains set until the static initializer completes. … Read more

Coordinating parallel execution in node.js

Nothing is truly parallel in node.js since it is single threaded. However, multiple events can be scheduled and run in a sequence you can’t determine beforehand. And some things like database access are actually “parallel” in that the database queries themselves are run in separate threads but are re-integrated into the event stream when completed. … Read more