Deadlocks
8 Questions
11 Views

Choose a study mode

Play Quiz
Study Flashcards
Spaced Repetition
Chat to lesson

Podcast

Play an AI-generated podcast conversation about this lesson

Questions and Answers

Which of the following statements are correct about synchronization in Go?

  • The Go language supports go routines, which are lightweight concurrent threads managed by the Go runtime. (correct)
  • b. The Go runtime maps a potentially large number of concurrent go routines to a much smaller pool of operating system level threads. (correct)
  • c. The default synchronization approach in Go is to communicate by sharing memory.
  • d. Go provides communication channels to solve coordination problems. (correct)
  • Which of the following statements are correct about synchronization in Java?

  • Java uses the special keyword synchronized to mark methods as critical sections. (correct)
  • Java provides wait() and notify() methods that resemble condition variables in the POSIX thread API. (correct)
  • Java uses the special keyword exclusive to mark methods as critical sections.
  • The mutual exclusion is associated to an object instance in Java. (correct)
  • Which of the following statements are true for deadlock avoidance?

  • A safe state is a state from which no deadlock can occur. (correct)
  • The banker’s algorithm allows to increase the maximum resource requests of a running process dynamically.
  • The banker’s algorithm requires that all active resource allocations are known. (correct)
  • The banker’s algorithm avoids deadlocks by granting resource requests only if the resulting state is safe. (correct)
  • Which of the following statements are true for deadlock detection?

    <p>A cycle in a wait-for graph may indicate a deadlock.</p> Signup and view all the answers

    How can deadlocks be prevented from occuring?

    <p>Deadlocks can be prevented by always dropping all resources before allocating a new set of resources.</p> Signup and view all the answers

    Which of the following statements are true about the Dining Philosophers problem?

    <p>Solutions preventing deadlocks may still lead to starvation.</p> Signup and view all the answers

    Which of the following conditions are necessary for a deadlock?

    <p>Hold and wait</p> Signup and view all the answers

    Which of the following statements are true for resource allocation graphs (RAGs)?

    <p>A directed edge from a process to a resource type indicates that a process requests and instance of the resource type.</p> Signup and view all the answers

    More Like This

    Concurrency in Functional Programming
    27 questions
    Thread Synchronization in Java
    24 questions
    Go Concurrency Model Quiz
    5 questions
    Use Quizgecko on...
    Browser
    Browser