{"id":3695,"date":"2016-05-15T22:56:07","date_gmt":"2016-05-15T16:56:07","guid":{"rendered":"https:\/\/mcqacademy.com\/en\/mcq\/choose-the-right-option-for-this-scenario\/"},"modified":"2016-05-15T22:56:07","modified_gmt":"2016-05-15T16:56:07","slug":"choose-the-right-option-for-this-scenario","status":"publish","type":"mcq","link":"https:\/\/mcqacademy.com\/en\/mcq\/choose-the-right-option-for-this-scenario\/","title":{"rendered":"Choose the right option for this scenario &#8211;"},"content":{"rendered":"<p>Assume the following method is properly synchronized and called from a thread A on an object B:<\/p>\n<p><code>wait(2000);<\/code><\/p>\n<p>After calling this method, when will the thread A become a candidate to get another turn at the CPU?<\/p>\n","protected":false},"author":4,"featured_media":0,"comment_status":"open","ping_status":"closed","template":"","topic":[107],"subject":[16],"education_level":[],"class_list":["post-3695","mcq","type-mcq","status-publish","hentry","topic-threads","subject-java-programming"],"mcq_note":"<strong>Option A.<\/strong> Either of the two events (notification or wait time expiration) will make the thread become a candidate for running again.\r\n\r\n<strong>Option B.<\/strong> is incorrect because a waiting thread will not return to runnable when the lock is released, unless a notification occurs.\r\n\r\n<strong>Option C.<\/strong> is incorrect because the thread will become a candidate immediately after notification, not two seconds afterwards.\r\n\r\n<strong>Option D.<\/strong> is also incorrect because a thread will not come out of a waiting pool just because a lock has been released.","mcq_options":[{"right":"yes","answer":"After thread A is notified, or after two seconds."},{"right":"no","answer":"After the lock on B is released, or after two seconds."},{"right":"no","answer":"Two seconds after thread A is notified."},{"right":"no","answer":"Two seconds after lock B is released."}],"multi_answers":"no","subject_terms":[{"id":16,"title":"Java Programming","slug":"java-programming"}],"topic_terms":[{"id":107,"title":"Threads","slug":"threads"}],"_links":{"self":[{"href":"https:\/\/mcqacademy.com\/en\/wp-json\/wp\/v2\/mcq\/3695","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mcqacademy.com\/en\/wp-json\/wp\/v2\/mcq"}],"about":[{"href":"https:\/\/mcqacademy.com\/en\/wp-json\/wp\/v2\/types\/mcq"}],"author":[{"embeddable":true,"href":"https:\/\/mcqacademy.com\/en\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/mcqacademy.com\/en\/wp-json\/wp\/v2\/comments?post=3695"}],"wp:attachment":[{"href":"https:\/\/mcqacademy.com\/en\/wp-json\/wp\/v2\/media?parent=3695"}],"wp:term":[{"taxonomy":"topic","embeddable":true,"href":"https:\/\/mcqacademy.com\/en\/wp-json\/wp\/v2\/topic?post=3695"},{"taxonomy":"subject","embeddable":true,"href":"https:\/\/mcqacademy.com\/en\/wp-json\/wp\/v2\/subject?post=3695"},{"taxonomy":"education_level","embeddable":true,"href":"https:\/\/mcqacademy.com\/en\/wp-json\/wp\/v2\/education_level?post=3695"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}