Loading...

OPERATING SYSTEMS ADMINISTRATION  

>

LEARNING OUTCOME 2

Process Management

Process Definition

A process is an instance of a program in execution.

It's a dynamic entity that requires system resources like CPU time, memory, and I/O devices to perform its tasks. Key characteristics of a process include:

Process Creation and Termination

Process Control Block (PCB)

The PCB is a data structure that contains information about a process, including:

Process Life Cycle

A process goes through different states during its lifetime:

  1. New: The process is being created.
  2. Ready: The process is waiting to be assigned to a CPU.
  3. Running: The process is currently executing on a CPU.
  4. Waiting: The process is waiting for an event (e.g., I/O operation).
  5. Terminated: The process has finished execution.

Process Management in Windows and Linux

Commonly Used Commands and Tools

CPU Scheduling

CPU scheduling is the process of determining which process should be executed next on a CPU. The goal is to optimize resource utilization and system performance.

Types of Scheduling

Process Scheduling Algorithms

  1. First-Come, First-Served (FCFS): Processes are executed in the order they arrive in the ready queue.
  2. Shortest Job First (SJF): The process with the shortest estimated burst time is executed first.
  3. Priority Scheduling: Processes are assigned priorities, and the highest-priority process is executed first.
  4. Round Robin: Each process is allocated a fixed time slice.
  5. Shortest Remaining Time First (SRTF): Similar to SJF but considers the remaining burst time of processes.

Inter-Process Communication (IPC)

Inter-process communication (IPC) is a mechanism that allows different processes to communicate and synchronize their activities.

Common IPC Mechanisms:

  1. Pipes: A unidirectional communication channel that allows data to flow from one process to another.
  2. Message Queues: A queue of messages that can be accessed by multiple processes.
  3. Shared Memory: A block of memory that can be accessed by multiple processes.
  4. Semaphores: A synchronization mechanism that controls access to shared resources.
  5. Sockets: A network programming interface that allows processes to communicate over a network.

Process Synchronization

Process synchronization is the coordination of multiple processes or threads that access shared resources to ensure data consistency and prevent race conditions.

Types of Process Synchronization

  1. Mutual Exclusion: Ensures that only one process can access a shared resource at a time.
  2. Cooperation: Involves coordination among processes to achieve a common goal.

Critical Section

A critical section is a code segment that accesses shared resources. It's crucial to ensure that only one process enters the critical section at a time to avoid race conditions.

Synchronization Mechanisms

  1. Semaphores: A semaphore is an integer variable that can be accessed only through two atomic operations: wait and signal.
  2. Mutexes: A mutex (mutual exclusion) is a synchronization primitive that allows only one thread to access a shared resource at a time.
  3. Monitors: A high-level synchronization construct that encapsulates shared data and the procedures that operate on it.
  4. Spinlocks: A low-level synchronization primitive that continuously checks a lock variable until it becomes available.

Deadlock in Operating Systems

Deadlock is a situation in which two or more processes are blocked indefinitely, waiting for each other to release resources. This can occur when processes compete for shared resources and the system fails to allocate resources in a way that prevents circular waiting.

Conditions for Deadlock

Four necessary conditions must hold for a deadlock to occur:

Strategies for Handling Deadlock

End of Outcome Quiz

1 of 20

    Quiz Score

    Percentage: 0%

    Answered Questions: 0

    Correct Answers: 0

    Faults: