JVM Languages like Java and Scala have the ability to run concurrent code using the Thread
class. Threads are notoriously complex and very error prone, so having a solid understanding of how they work is essential.
Let’s start with the Javadoc for Thread.sleep
:
Causes the currently executing thread to sleep (temporarily cease execution) for the specified number of milliseconds
What are the implications of cease execution, also known as blocking, and what does it mean? Is it bad? And if so can we achieve non-blocking sleep?
This post covers a lot of ground and hopefully you will learn a lot of cool things.
#java #programming #developer