Multithreading


  1. Deadlock is a situation when thread is waiting for other thread to release acquired object.











  1. 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.


  1. What is true about time slicing?











  1. 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.



  1. What decides thread priority?











  1. 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.


  1. What does not prevent JVM from terminating?











  1. 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.



  1. What requires less resources?











  1. 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.