Describe one reason for entering each of the following states:
a) Sleeping state.
b) Blocked state.
c) Ready state.
d) Dead state.
e) Waiting state.
a) Sleeping state.
ANS: When a running thread calls function time.sleep, that thread enters the sleep-
ing state.
b) Blocked state.
ANS: One common way for a running thread to enter the blocked state occurs when the thread issues an input/output request.
c) Ready state.
ANS: Invoking a thread’s start method causes the thread to enter the ready state.
d) Dead state.
ANS: A thread enters the dead state when its run method completes or terminates for any reason.
e) Waiting state.
ANS: Condition variable method wait releases the underlying lock and causes the
thread to enter the waiting state until it is awakened by a call to notify on the
same condition variable.
You might also like to view...
A(n) ____ tag is used to define a section of text and/or images that belong together.
A. command B. cluster C. section D. aggregate
Left Arrow is an example of a Crop to Shape option in the Shape gallery
Indicate whether the statement is true or false
What happens when you click a hyperlink field value while in Datasheet view?
A) Access saves the corresponding file. B) Access creates a ScreenTip that appears when you hover over the hyperlink. C) Access adds an attachment to the table. D) Access launches the program required to display the file or Web page.
When you visit a secure website in Internet Explorer, a padlock icon displays in the notification bar indicating that a digital certificate identifies the site
Indicate whether the statement is true or false