Multithreading
- Deadlock is a situation when thread is waiting for other thread to release acquired object.
-
View Hint View Answer Discuss in Forum
NA
Correct Option: B
Deadlock is java programming situation where one thread waits for an object lock that is acquired by other thread and vice-versa.
- What is true about time slicing?
-
View Hint View Answer Discuss in Forum
NA
Correct Option: C
Time slicing is the process to divide the available CPU time to available runnable thread.
- What decides thread priority?
-
View Hint View Answer Discuss in Forum
NA
Correct Option: B
Thread scheduler decides the priority of the thread execution. This cannot guarantee that higher priority thread will be executed first, it depends on thread scheduler implementation that is OS dependent.
- What does not prevent JVM from terminating?
-
View Hint View Answer Discuss in Forum
NA
Correct Option: C
Daemon thread runs in the background and does not prevent JVM from terminating. Child of daemon thread is also daemon thread.
- What requires less resources?
-
View Hint View Answer Discuss in Forum
NA
Correct Option: A
Thread is a lightweight and requires less resources to create and exist in the process. Thread shares the process resources.