Threads in Java. Java multithreading examples.
Are you going to code a Java application that processes multiple tasks at the same time? Or is your program doing some heavy operations in the background, while the user is viewing a chart report? Such applications are referred as multi-threaded or concurrency programs. The Java platform has built-in support for threading from its very early versions, so developing multi-threaded applications in Java is not tough at all, thanks to the comprehensive and powerful threading and concurrency API.
Following diagrams display different thread states. Thread States
• Runnable: Thread in this state is waiting for its turn to start execution.
• Running: Thread is executing and performing its functionality.
• Waiting: Thread is in blocked state and waiting for some operation to finish.
• Sleeping: Thread is suspended forcefully.
• Blocked on I/O: Thread will start execution after completion of