Yield method is one way to request current thread to relinquish CPU so that other thread can get chance to execute. Yield is a static method and only guarantees that current thread will relinquish the CPU but doesn't say anything about which other thread will get CPU. Its possible for same thread to get CPU back and start its execution again.
-
Previous Java ProgrammingWhat is concurrence level of ConcurrentHashMap in Java?
-
Next On Java ProgrammingThere are three threads T1, T2 and T3? How do you ensure sequence T1, T2, T3 in Java?
No Comment to " What does yield method of Thread class do? "