6. Assume the following method is properly synchronized and called from a thread A on an object : wait(2000): After call

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

6. Assume the following method is properly synchronized and called from a thread A on an object : wait(2000): After call

Post by answerhappygod »

6 Assume The Following Method Is Properly Synchronized And Called From A Thread A On An Object Wait 2000 After Call 1
6 Assume The Following Method Is Properly Synchronized And Called From A Thread A On An Object Wait 2000 After Call 1 (25.51 KiB) Viewed 33 times
6. Assume the following method is properly synchronized and called from a thread A on an object : wait(2000): After calling this method, when will the thread A become a candidate to get another turn at the CPU? 7. Which of the following methods make a thread leave the running state? 1. yield il wait) til notify iv. notifyAllo v. sleep(1000) vi. Thread.join() vii. Thread kill Threado 8. What is the output of the following code? public class ThreadDemo extends Thread private int x=0; private int y=0; public static void main(String (I args) ThreadDemo obj = new ThreadDemol): (new Thread(obj).start(): obj.start(): ) public synchronized void run 0 for (int i=0;13, 1++) X; Y++; System.out.println("x=" +x+"y"+y);
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply