1. Assume the following method is properly synchronized and called from a thread A on an object B: wait(2000); After calling this method, when will the thread A become a candidate to get another turn at the CPU?





Ask Your Doubts Here

Type in
(Press Ctrl+g to toggle between English and the chosen language)

Comments

  • By: guest on 02 Jun 2017 01.26 am
    Option A. Either of the two events (notification or wait time expiration) will make the thread become a candidate for running again. Option B is incorrect because a waiting thread will not return to runnable when the lock is released, unless a notification occurs. Option C is incorrect because the thread will become a candidate immediately after notification, not two seconds afterwards. Option D is also incorrect because a thread will not come out of a waiting pool just because a lock has been released.
Show Similar Question And Answers
QA->John started from his home and walked 12 km.Then he took a right turn and walked 4 km.Then again,he took a right turn and walked 8 km and finally took another right turn and walked 1 km.How far is he from his home now?....
QA->A girl started counting the fingers of her left hand, calling the thumb 1, the index finger 2, middle finger 3, ring finger 4, little finger 5 and then reversed the direction calling the ring finger 6 middle finger 7 and do on. She counted upto She ended counting on ……………… finger....
QA->Rahim travelled straight from point E to F at a distance of 5 km. From F he turned left and travelled 6 km and reached point G, there he took a left turn and travelled 5 km to reach point H. He took another left turn and travelled 2 km and reached point I. How far is he from the starting point ?....
QA->When an object travels around another object it is known as?....
QA->In 1938, Subhash Chandra Bose was elected as the president of Indian National Congress defeating Gandhiji’s candidate. Who was this candidate?....
MCQ->Assume the following method is properly synchronized and called from a thread A on an object B: wait(2000); After calling this method, when will the thread A become a candidate to get another turn at the CPU?

....
MCQ->Which two statements are true? Deadlock will not occur if wait()/notify() is used A thread will resume execution as soon as its sleep duration expires. Synchronization can prevent two objects from being accessed by the same thread. The wait() method is overloaded to accept a duration. The notify() method is overloaded to accept a duration. Both wait() and notify() must be called from a synchronized context.....
MCQ->Which two can be used to create a new Thread? Extend java.lang.Thread and override the run() method. Extend java.lang.Runnable and override the start() method. Implement java.lang.Thread and implement the run() method. Implement java.lang.Runnable and implement the run() method. Implement java.lang.Thread and implement the start() method.....
MCQ->What will be the output of the program? class Happy extends Thread { final StringBuffer sb1 = new StringBuffer(); final StringBuffer sb2 = new StringBuffer(); public static void main(String args[]) { final Happy h = new Happy(); new Thread() { public void run() { synchronized(this) { h.sb1.append("A"); h.sb2.append("B"); System.out.println(h.sb1); System.out.println(h.sb2); } } }.start(); new Thread() { public void run() { synchronized(this) { h.sb1.append("D"); h.sb2.append("C"); System.out.println(h.sb2); System.out.println(h.sb1); } } }.start(); } }....
MCQ->You install and run a third-party 32-bit application named Application on your Windows 2000 Server computer. After several days, the application stops responding. You open Task Manager and find that the CPU usage is at 100 percent. The normal range of CPU usage on the server is from 20 percent to 30 percent You end the application. However, you see that the CPU on the server is still at 100 percent. Task Manager shows no other applications running. You then examine the Processes page in Task Manager and confirm that the Application.exe process is no longer running. You want to return the CPU usage to its normal range. What should you do?....
Terms And Service:We do not guarantee the accuracy of available data ..We Provide Information On Public Data.. Please consult an expert before using this data for commercial or personal use | Powered By:Omega Web Solutions
© 2002-2017 Omega Education PVT LTD...Privacy | Terms And Conditions
Question ANSWER With Solution