0% found this document useful (0 votes)
2 views

Process Management Presentation

Process management in operating systems involves the creation, scheduling, and termination of processes and threads. Processes can exist in various states such as new, running, waiting, ready, and terminated, with scheduling algorithms determining the order of execution. Additionally, system calls facilitate process management, while the Process Control Block (PCB) stores essential information about each process, and real-time process management ensures tasks meet strict timing constraints.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

Process Management Presentation

Process management in operating systems involves the creation, scheduling, and termination of processes and threads. Processes can exist in various states such as new, running, waiting, ready, and terminated, with scheduling algorithms determining the order of execution. Additionally, system calls facilitate process management, while the Process Control Block (PCB) stores essential information about each process, and real-time process management ensures tasks meet strict timing constraints.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 13

Process Management

Understanding How Operating Systems


Manage Processes and Threads
• Processes are programs that are in execution,
consisting of a program counter, registers, and
variables.

• Threads are smaller units within a process, sharing


What is resources like memory but running independently.
Process
Management? • Process Management in an OS involves creating,
scheduling, and terminating processes.

• The OS ensures processes are executed efficiently


and fairly while managing system resources.
• • A process can be in various states
during its lifecycle:
• 1. New: The process is being created.
• 2. Running: The process is currently
executing.
• 3. Waiting: The process is waiting for a
resource or event (e.g., I/O).

Process States • 4. Ready: The process is ready to


execute but is waiting for the CPU.
• 5. Terminated: The process has finished
executing and is being removed from
memory.
• • State Transition: Processes move
between these states based on system
events.
Process Scheduling

• • Scheduling Algorithms determine which process runs next:


• 1. Round Robin (RR): Processes take turns executing for a set time slice.
• 2. First-Come, First-Served (FCFS): The process that arrives first is executed first.
• 3. Priority Scheduling: Processes are assigned priority levels, and the highest priority runs
first.
• 4. Shortest Job Next (SJN): The process with the smallest execution time is scheduled
next.
• • Multilevel Queue Scheduling: Uses multiple queues to handle different priorities of
processes.
System Calls for
Process Management

• • System Calls are the interface between


user programs and the OS kernel:
• - fork(): Creates a new process by
duplicating the current process.
• - exec(): Replaces the current process
with a new program.
• - wait(): Makes the parent process wait
for the termination of a child process.
• • Interprocess Communication (IPC)
allows processes to exchange data or
signals.
Process Control Block (PCB)

• • The Process Control Block (PCB) stores information about each process.
• • Key Fields in a PCB:
• - Process ID (PID): Unique identifier for the process.
• - Program Counter (PC): Stores the address of the next instruction to execute.
• - CPU Registers: Holds values needed by the CPU to execute the process.
• - Memory Management Info: Contains information about the process’s memory
allocation.
• - Process State: Indicates whether the process is running, waiting, etc.
• - I/O Status Info: Includes I/O devices allocated to the process.
Multitasking and
Multithreading
• • Multitasking allows multiple
processes to run concurrently by
sharing system resources.
• • Multithreading is the ability of a
process to split into multiple
threads, allowing multiple tasks to
be performed simultaneously.
• • Multitasking vs Multithreading:
• - Multitasking: Multiple processes
run at the same time.
• - Multithreading: Multiple tasks
run within the same process.
Zombie and Orphan
Processes
• Zombie Processes: A process that has finished execution but still
has an entry in the process table because its parent has not read its
exit status.
- Problem: Consumes resources and could fill up the process table.

- Solution: The parent process should read the exit status using
wait().

• Orphan Processes: A child process whose parent has terminated


before it.

- Problem: The system assigns a new parent (typically the init


process) to clean up resources.
• Termination occurs when a process has completed
its execution or has been terminated by another
process.

- Normal Termination: The process finishes


Process execution.

Termination - Abnormal Termination: The process is killed due to


errors or external signals (e.g., kill()).

• Clean-Up: The OS deallocates resources such as


memory and I/O devices, and the process’s PCB is
removed.
Real-Time Process
Management
• • Real-Time Systems have strict timing
constraints and must complete tasks within a
specified deadline.
• - Hard Real-Time: Tasks must complete
within a fixed deadline.
• - Soft Real-Time: Tasks must complete as
quickly as possible, but missing a deadline is
acceptable.
• • Real-Time Scheduling: Algorithms like Rate
Monotonic Scheduling (RMS) or Earliest
Deadline First (EDF) ensure time-critical tasks
meet their deadlines.
Conclusion

• Process management is a • Managing processes and


• Understanding process
critical component of threads helps optimize
states, scheduling, and
operating systems, system performance and
system calls is essential for
ensuring efficient handle complex tasks in
system administration and
execution and resource multi-user and multi-task
penetration testing.
allocation. environments.
Practice Questions (Review Slides 1-4)

WHAT IS THE PRIMARY ROLE EXPLAIN THE DIFFERENCE WHAT ARE THE DIFFERENT WHAT IS PROCESS
OF PROCESS MANAGEMENT BETWEEN A PROCESS AND A STATES A PROCESS CAN BE SCHEDULING, AND WHY IS IT
IN AN OPERATING SYSTEM? THREAD. IN? ESSENTIAL FOR AN OS?
Practice Questions (Review Slides 5-11)

WHAT SYSTEM CALLS ARE DESCRIBE THE PROCESS WHAT IS THE DIFFERENCE HOW DO ORPHAN AND WHAT STEPS ARE EXPLAIN THE
INVOLVED IN PROCESS CONTROL BLOCK (PCB) BETWEEN MULTITASKING ZOMBIE PROCESSES INVOLVED IN THE IMPORTANCE OF REAL-
MANAGEMENT? AND ITS KEY FIELDS. AND MULTITHREADING? DIFFER FROM EACH TERMINATION OF A TIME PROCESS
OTHER? PROCESS? MANAGEMENT.

You might also like