Explain the difference between yielding and sleeping?
Submitted by: AdministratorSleep causes the currently executing thread to sleep until the specified time is completed. The thread will resume once the specified time period is over.
Sleep causes the currently executing thread to sleep and gives a chance to other threads to execute. The thread will join the ready queue.
Thread.sleep() will moves the thread to “Wait” state.
Thread.yield() will moves the thread to “Ready” state.
Submitted by: Administrator
Sleep causes the currently executing thread to sleep and gives a chance to other threads to execute. The thread will join the ready queue.
Thread.sleep() will moves the thread to “Wait” state.
Thread.yield() will moves the thread to “Ready” state.
Submitted by: Administrator
Read Online Java Multi-Threading Job Interview Questions And Answers
Top Java Multi-Threading Questions
☺ | Explain deadlock? |
☺ | What is the sleep() method Data type for the parameter? |
☺ | Explain the difference between preemptive scheduling and time slicing? |
☺ | How many threads at a time can access a monitor? |
☺ | Name the default thread at the time of starting the program? |
Top Java Programming Language Categories
☺ | Core Java Interview Questions. |
☺ | Hibernate Interview Questions. |
☺ | Advanced Java Interview Questions. |
☺ | IBM WebSphere Interview Questions. |
☺ | Spring Framework Interview Questions. |