I'm a bit confused about what exactly the phrase "has just executed the line marked //LINE..." refers to.
Based on the correct answer, in the case of LINE 10, it seems to mean before the status changes from TIMED_WAITING to RUNNABLE.
However, in the case of LINE 21, it seems to mean after the status has already changed from RUNNABLE to BLOCKED.
This feels inconsistent to me. Could you please clarify?
About Question enthuware.ocpjp.v21.2.4003 :
Moderator: admin
-
- Posts: 21
- Joined: Sat Sep 01, 2018 10:53 am
- Contact:
-
- Site Admin
- Posts: 10382
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.ocpjp.v21.2.4003 :
It is just trying to convey that the statements that have been just been executed by each thread. The calculation thread has executed Thread.sleep(5000);, which means this thread is now in TIMED_WAITING state. The sleep time is not over yet (because it has *just* executed the sleep instruction. It will sleep for 5 seconds now.)
The main thread has just executed synchronized(c), which means, it is now in BLOCKED state because the lock is not free.
The main thread has just executed synchronized(c), which means, it is now in BLOCKED state because the lock is not free.
-
- Posts: 21
- Joined: Sat Sep 01, 2018 10:53 am
- Contact:
Re: About Question enthuware.ocpjp.v21.2.4003 :
Thank you, I somehow didn’t pay attention to the fact that "just executed" and the moment after the 5-second sleep are two different things.
Who is online
Users browsing this forum: Bing [Bot] and 75 guests