0% found this document useful (0 votes)
3 views4 pages

Unit 2 Oss

The document outlines key concepts in process management, including process states, CPU scheduling algorithms, interprocess communication, multithreading models, process synchronization, and deadlock handling. It provides a structured format for answering questions related to these topics, emphasizing definitions, detailed explanations, examples, and conclusions. Additionally, it encourages the use of diagrams and technical terms to enhance clarity and understanding.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views4 pages

Unit 2 Oss

The document outlines key concepts in process management, including process states, CPU scheduling algorithms, interprocess communication, multithreading models, process synchronization, and deadlock handling. It provides a structured format for answering questions related to these topics, emphasizing definitions, detailed explanations, examples, and conclusions. Additionally, it encourages the use of diagrams and technical terms to enhance clarity and understanding.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

UNIT II – Process Management

Process Concept – Process Scheduling – Operation on Processes, Inter-process Communication – Threads – Overview –
Multithreading models – Threading issues; CPU Scheduling – Scheduling criteria, Scheduling algorithms; Process
Synchronization – critical-section problem, Synchronization hardware, Mutex locks, Semaphores, Critical regions, Monitors;
Deadlock – System model, Deadlock characterization, Methods for handling deadlocks, Deadlock prevention, Deadlock
avoidance, Detection, Recovery.

FORMAT TO ATTEND A 13-MARK QUESTION:

Follow this structure:

1. Definition / Introduction (2 marks)

2. Detailed Explanation with diagram/flow/table if applicable (6-7 marks)

3. Types / Examples / Equations / Code if needed (3-4 marks)

4. Conclusion (1-2 marks)

1. Process Concept
Question: Explain the process states and Process Control Block.

Answer Structure:

• Intro: Define a process – program in execution.

• Explain process states:

o New

o Ready

o Running

o Waiting

o Terminated

• Draw Diagram:

• New → Ready → Running → Waiting → Ready → Terminated

• Explain PCB:

o Process ID

o Registers

o Program Counter

o I/O status

o Accounting info

• Conclusion: PCB helps OS to manage and switch between processes.


2. CPU Scheduling

Question: Explain the various CPU scheduling algorithms with examples.

Answer Structure:

• Intro: Purpose is to allocate CPU efficiently.

• Explain Criteria: Throughput, Waiting Time, Turnaround, Response Time

• Algorithms (explain 3 at least):

o FCFS

o SJF (preemptive & non-preemptive)

o Priority Scheduling

o Round Robin

• Gantt Chart Example:


Use small process table and show waiting/turnaround time calculation.

• Conclusion: Each algorithm suits different scenarios; no one-size-fits-all.

3. Interprocess Communication (IPC)

Question: Describe various IPC mechanisms and operations on processes.

Answer Structure:

• Define IPC: Mechanism to allow processes to communicate

• Types:

o Shared Memory

o Message Passing

o Pipes / Sockets

• Operations on Processes:

o Create (fork())

o Execute (exec())

o Terminate (exit())

o Wait (wait())

• Draw diagram: Show how 2 processes communicate (optional)

• Conclusion: IPC is key for multitasking systems and client-server models.


4. Threads & Multithreading

Question: Explain multithreading models with diagrams.

Answer Structure:

• Define thread: Light-weight process

• Advantages: Less overhead, faster context switch

• Models:

o Many-to-One

o One-to-One

o Many-to-Many
(Draw diagrams with arrows between user & kernel threads)

• Threading Issues: Synchronization, cancellation, signal handling

• Conclusion: Threads improve efficiency in multi-core CPUs.

5. Process Synchronization

Question: Explain Critical Section Problem and solutions using semaphores.

Answer Structure:

• Define critical section: Shared resource access code

• Problem: Multiple processes may cause race conditions

• Conditions:

o Mutual Exclusion

o Progress

o Bounded Waiting

• Solutions:

o Peterson's Algorithm (for 2 processes)

o Semaphores:

▪ wait(), signal()

▪ Binary (mutex) and Counting semaphores

• Give example: Producer-Consumer using semaphore

• Conclusion: Synchronization ensures consistent resource usage.


6. Deadlock

Question: Describe deadlock and methods to handle it.

Answer Structure:

• Define Deadlock: Processes waiting forever for each other's resources

• 4 Necessary Conditions:

o Mutual Exclusion

o Hold & Wait

o No Preemption

o Circular Wait

• Handling Methods:

o Prevention: Break any condition (e.g., no hold & wait)

o Avoidance: Use Banker’s Algorithm

Show small example matrix

o Detection: Resource Allocation Graph

o Recovery: Terminate process or resource preemption

• Conclusion: Prevention is best but avoidance gives better resource utilization.

FINAL TIP FOR 13-MARKS:

• Structure neatly – Use headings, bullets, diagrams.

• Draw at least one diagram (process state, thread model, Gantt chart).

• Write at least 1 example or table (e.g., SJF Gantt chart or Banker’s table).

• Use technical terms, underline them.

• Aim for 2+ pages of answer with clear flow.

You might also like