Java Virtual Threads Under Load: Three Limits to Make Explicit

Virtual threads let us keep ordinary blocking code while many more requests wait concurrently. Under load, however, that brings three critical questions into focus: How much work do we admit? Cheap threads can still build an expensive queue. What belongs inside a lock? A sleeping lock holder still makes everyone else wait. Who stops abandoned … Read more

Java Thread Programming (Part 15)

Learn how to do asynchronous method invocation with Callable and Future with a practical example.

Java Thread Programming (Part 14)

What if we get a recursive situation when child tasks create more tasks and the parents wait for child tasks to finish?

Java Thread Programming (Part 13)

What is the maximum number of worker threads we can put in a ThreadPool? Let’s find out today on Foojay’s amazing Java threading series!

Java Thread Programming (Part 4)

We need to be very careful when using the “volatile” keyword, and we should use it only where it’s required, and definitely not everywhere.

Java Thread Programming (Part 3)

Tip: We can only ask the Java thread to execute a piece of code, but we cannot guarantee the execution order of multiple threads!

Java Thread Programming (Part 2)

Let’s see an example of where we can use Threads. Let’s assume we are building a web server that returns the most used words in a website.