Operating System: Mutual Exclusion

TopQualityPrime avatar
TopQualityPrime
·
·
Download

Start Quiz

Study Flashcards

10 Questions

What is the purpose of jacketing?

To convert a blocking system call into a non-blocking system call

What is a critical section of code?

A section of code that requires access to shared resources

What happens when a thread needs to wait for an event?

It blocks, saving its user registers, program counter, and stack pointers

What is a deadlock?

A situation in which two or more processes are unable to proceed because each is waiting for one of the others to do something

What is the requirement that ensures no other process may be in a critical section that accesses shared resources when one process is in a critical section?

Mutual Exclusion

What is a situation in which multiple threads or processes read and write a shared data item and the final result depends on the relative timing of their execution?

Race Condition

What is an atomic operation?

A function or action implemented as a sequence of one or more instructions that appears to be indivisible

What happens when a thread completes?

Its register context and stacks are deallocated

What is a situation in which two or more processes continuously change their states in response to changes in the other process(es) without doing any useful work?

Live-lock

What happens when a new process is spawned?

A thread for that process is also spawned

Study Notes

Mutual Exclusion

  • When one process uses a shared resource, other processes that need access to the same resource are excluded from using it simultaneously.
  • Only one process can access a shared resource at a time, and all other processes must wait.

Critical Section

  • The part of code in a process that accesses and uses a shared resource is called the critical section.
  • Only one process can enter the critical section at a time to avoid undesirable events.

Process Concepts

  • Process spawning occurs when the OS creates a process at the explicit request of another process.
  • The process that spawns another process is referred to as the parent process, and the spawned process is referred to as the child process.

Semaphores

  • A semaphore is an abstract data type that functions as a software synchronization tool to implement a solution to the critical section problem.
  • Semaphores can be used to synchronize access to shared resources.

Producer-Consumer Problem

  • The producer-consumer problem involves two processes: the producer process, which produces data items and inserts them in a buffer, and the consumer process, which removes data items from the buffer and consumes them.

Multi-Threading

  • Multi-threading refers to the ability of an OS to support multiple, concurrent paths of execution within a single process.
  • A thread is a unit of dispatching, and a process is a unit of resource ownership.

Context Switch

  • When the OS interrupts an executing process, it carries out a context switch, changing the CPU from one process to another.
  • The time it takes for this changeover is called the context switch time.

Deadlocks

  • A deadlock is a state of indefinite waiting that processes may reach when competing for system resources or when attempting to communicate.
  • Four conditions are necessary for the existence of a deadlock: mutual exclusion, hold and wait, no preemption, and circular wait.

Synchronization

  • Synchronization is the coordination of activities of two or more processes that need to carry out certain activities, such as competing for resources in a mutually exclusive manner or cooperating in sequencing or ordering specific events.

Blocking and Unblocking

  • A thread blocks when it waits for an event, saving its user registers, program counter, and stack pointers.
  • A thread is unblocked when the event for which it was blocked occurs, and it is moved to the Ready queue.

Atomic Operations

  • An atomic operation is a function or action implemented as a sequence of one or more instructions that appears to be indivisible, and no other process can see an intermediate state or interrupt the operation.

Learn about mutual exclusion in operating systems where a shared resource can only be accessed by one process at a time. Understand critical sections and how they relate to shared resources.

Make Your Own Quizzes and Flashcards

Convert your notes into interactive study material.

Get started for free

More Quizzes Like This

Use Quizgecko on...
Browser
Browser