Page 1 of 1
About Question enthuware.ocpjp.v17.2.3753 :
Posted: Fri Jan 20, 2023 7:47 am
by shwetagulati
Calling interrupt on a thread that it is in TIMED_WAITING or WAITING or BLOCKED state causes an interrupted exception? is that true?
or in simple words which are all the states in which if a thread is, , can cause interrupted exception on calling interrupt?
Re: About Question enthuware.ocpjp.v17.2.3753 :
Posted: Fri Jan 20, 2023 9:32 am
by admin
TIMED_WAITING or WAITING or BLOCKED
Re: About Question enthuware.ocpjp.v17.2.3753 :
Posted: Fri Jan 20, 2023 9:54 am
by shwetagulati
thanks
Re: About Question enthuware.ocpjp.v17.2.3753 :
Posted: Tue Dec 05, 2023 3:23 am
by mellester
I get that a thread that is running does not get a InterruptedException.
However in this question a interrupt is fired 300 mile seconds after T1 is started there must be something really weird going on if T1 is not always in waiting at that time.
Can I just not reason with these time frames.
Re: About Question enthuware.ocpjp.v17.2.3753 :
Posted: Tue Dec 05, 2023 4:52 am
by admin
Not sure I understand your question. Can you please rephrase?
Re: About Question enthuware.ocpjp.v17.2.3753 :
Posted: Sat Feb 22, 2025 8:30 pm
by raphaelzintec
very good explanation but you dont explain why T1 RUNNABLE can be printed only 1 time, you explain 3 options with T1 RUNNABLE printed two times
Re: About Question enthuware.ocpjp.v17.2.3753 :
Posted: Sun Feb 23, 2025 5:27 am
by admin
Not sure what I understand your doubt. If you are clear that T1 RUNNABLE can be printed two times, doesn't that mean T1 RUNNABLE cannot be printed only 1 time?