Wednesday, 26 September 2018

Consider there are two threads, Even Thread - Print only Even numbers Odd Thread - Print only Odd numbers Print numbers from 1 to 50 by switching Odd and Even Threads, Approach: step 1. Create each threads with synchronized block step 2. Create Monitor object with shared thread status and shared number step 3. loop through mo.number and wait or execute based on the shared thread status      ...
Page 1 of 101234567...10Next »Last

Search This Blog

Contact us

Name

Email *

Message *