How do we specify pause times in my program?

How do we specify pause times in my program?

- Using the sleep function in Java, the thread’s execution can be put on hold. During this pause session, the thread does not loose ownership of the monitors.

- Syntax:
Public static void sleep(long millis)
Throws InterruptedExecution

- Here, millis is the time in mili seconds to hold the threads execution.
Multithreaded program and importance of thread synchronization
Multithreaded program and importance of thread synchronization - A multithreaded program involves multiple threads of control in a single program. Each thread has its own stack...
When a thread is created and started, what is its initial state?
When a thread is created and started, what is its initial state? - A thread is in “Ready” state after it has been created and started...
What are the high-level thread states?
What are the high-level thread states? - The thread can be in one of the following states: Running state, Ready state, Dead state and Waiting state...
Post your comment