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. (B), An unusual low load on server machines may indicate a deadlock. (C), A variation of the banker’s algorithm can be used to detect deadlocks. (D)</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. (B), Deadlocks can be prevented by always allocating resources in a certain order and by dropping all resources if a lower numbered resource is required. (C), Deadlocks can be prevented by making all resources sharable. (D)</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. (B), Deadlocks can be avoided by having a waiter server spaghetti to one philosopher at a time only. (C), Deadlocks can be avoided by always picking up forks in a defined order. (D)</p> Signup and view all the answers

Which of the following conditions are necessary for a deadlock?

<p>Hold and wait (A), Mutual exclusion (B), Circular wait (C), No preemption (D)</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. (C), If every resource type has only a single instance, then a cycle in the RAG is a necessary and a sufficient condition for a deadlock. (D)</p> Signup and view all the answers

Flashcards

Go Routines

Lightweight concurrent threads managed by the Go runtime.

Java Synchronization

Using the synchronized keyword to mark critical sections in methods.

Safe State (Deadlock)

A state in which no deadlock can occur.

Deadlock Detection (Graph)

A cycle in a wait-for graph may indicate a deadlock.

Signup and view all the flashcards

Deadlock Prevention

Preventing deadlocks by carefully managing resource allocation.

Signup and view all the flashcards

Dining Philosophers - Starvation

Solutions to prevent deadlocks may sometimes lead to starvation.

Signup and view all the flashcards

Deadlock Necessary Condition

Hold and wait is one necessary condition for a deadlock.

Signup and view all the flashcards

Resource Allocation Graph (RAG)

A type of graph used to represent process resource requests.

Signup and view all the flashcards

More Like This

Use Quizgecko on...
Browser
Browser