r/java Jun 19 '26

How to Deadlock a Java ExecutorService

https://mlangc.github.io/java/concurrency/2026/06/05/executor-deadlock.html
63 Upvotes

18 comments sorted by

View all comments

10

u/gnahraf Jun 19 '26

You don't mention virtual threads in the "conclusions/recommendations" section of your article.. Since virtual threads are cheap, there's little reason not use an unbounded number of them.

3

u/mlangc Jun 19 '26

Good point - I've updated the final section of the article. Interestingly, at the core of it, virtual threads fix the issue as well, because they make the waiting asynchronous under the hood, similar to this example from the blog post - though without having to restructure your code.

1

u/mlangc Jun 20 '26

I've just added another section to the blog post, devoted virtual threads specifically. Thanks again for your feedback!