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

Understanding Starvation in OS

This document contains 15 units of questions related to operating systems. The questions cover topics such as multi-tasking, scheduling, concurrency, memory management, file systems, and more. Some example questions are about defining terms like multi-programming and context switching; comparing operating system types like batch, time-sharing, and real-time; explaining concepts like deadlock and critical section problems; and analyzing memory management algorithms like FIFO and LRU page replacement. The questions provide a comprehensive overview of key operating system concepts to test understanding.

Uploaded by

Mohan Patel
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
41 views4 pages

Understanding Starvation in OS

This document contains 15 units of questions related to operating systems. The questions cover topics such as multi-tasking, scheduling, concurrency, memory management, file systems, and more. Some example questions are about defining terms like multi-programming and context switching; comparing operating system types like batch, time-sharing, and real-time; explaining concepts like deadlock and critical section problems; and analyzing memory management algorithms like FIFO and LRU page replacement. The questions provide a comprehensive overview of key operating system concepts to test understanding.

Uploaded by

Mohan Patel
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

Unit 1 Questions

1. Explain the following terms:

a. multi programming and multi tasking

b. spooling and buffering

c. racing

d. context switching

e. system call

f. fork system call

2. What are the functions of operating system? Explain various steps involving in routine what are the
different services provided by operating system ?

3. Compare the monolithic and layered architecture.

4. What is operating system? Define the essential properties of the following types of operating sytem:

a. Batch
b. Time sharing
c. Real time operating system
d. Explain the following terms:
e. Spooling
f. Multiprogramming
g. CPU bound & I/O bound
h. System Call

[Link] process & thread.

6. What is Bootstrap program? Explain.


7. What is the difference between user level thread & kernel level thread?
8. What is the layered architecture? Explain the need of operating.

Unit 2 Questions
1. Explain primitive and non primitive scheduling.
2. Discuss multiprogram vs single user system on the basis of throughput and cpu utilization.
3. What is starvation in Operating System?
4. What is aging in Operating System?
5. What is process state and transaction diagram?

6. Explain short term medium term and long term scheduling?


7. What is the basic environment for execution of concurrent processes?
8. What is a process and process table?
9.

Unit 3 Questions
1. What is critical section problem? explain 2 process solution ?
2. Write a semaphore solution for reader writer problem and dinning philosopher's problem.
3. What are the various ways to avoid deadlock.
4. What are the conditions to hold for deadlock occur.
5. Explain the following terms

Race condition

two process solution

6. Write short note on deadlock prevention techniques.


7. Define deadlock. Describe four conditions for occurrence of deadlock.
8.

Consider the following snapshot of a system.

Process Allocation MAX Available

A B C D A B C D A B C D

P0 0 0 1 2 0 0 1 2 1 5 2 0
p1 1 0 0 0 1 7 5 0

p2 1 3 5 4 2 3 5 6

p3 0 6 3 2 0 6 5 2

p4 0 0 1 4 0 6 5 6

Answer the following questions using the banker’s algorithm:

a. What is the content of the matrix Need?

b. Is the system in a safe state?

c. If a request from process P1 arrives for (0,4,2,0), can the request be

granted immediately?

12. What operations can be performed on a semaphore? what is the difference b/w binary and counting
semaphore?

13. Discuss the banker’s algorithm.

14. Explain deadlock prevention techniques.

15. Consider a system consisiting of 4 resources of the same [Link] are shared by 3 processes,each of
which needs atmost 2 resources. Show that the system is deadlock free.

Unit 4
1. What is the difference between logical address space and physical address
space?
2. Consider the main memory with capacity of 3 frames. Assume that the page of
a process ar referenced in te order as given below:

7,0,1,2,0,3,0,4,2,3,0,3

Which one is better FIFO or LRU and why?

3. Define Compaction.
4. What is Dirty bit?
5. What is page fault & when does it occur?
6. What are the main types of memory?
7. What is contiguous allocation?
8. What us paging and segmentation?
9. What is fragmentation?
10. How many types of fragmentation occur in Operating System?
11. What is Belady's Anomaly?
12. What is Virtual Memory? How is it implemented?
13. What is demand paging?
14. What is Thrashing?

Unit 5
1. Explain various methods of accessing file with examples.
2. The head of moving head disk with 200 tracks is currently serving a
request for truck 143 and has just finished a request at track 125. The queue
of requests is kept in the FIFO order: 86, 147, 91, 177, 94, 150, 102, 175, 130.
Explain which of the following disk-scheduling algorithms will have the
minimum amount of head movement to satisfy the above requests: (1) FCFS
(2) SSTF (3) SCAN (4) C-SCAN.

Common questions

Powered by AI

A semaphore is a synchronization tool used to control access to shared resources in concurrent systems. Semaphores can be of two types: counting semaphores, which allow a certain number of processes to access a resource, and binary semaphores (mutexes), which allow only one process at a time. In the reader-writer problem, semaphores can manage access such that multiple readers or a single writer can access the resource, but not both. A semaphore ensures mutual exclusion by allowing readers to read concurrently, blocking writers, while ensuring that writers have exclusive access when writing, thereby maintaining data consistency .

Demand paging is a memory management scheme whereby pages are loaded into memory only when a process requires them, reducing unnecessary memory usage by not pre-loading all pages. This scheme enhances memory efficiency by freeing up physical memory for active pages, allowing larger programs to run with limited RAM. When a needed page is not in memory, a page fault occurs, triggering the loading of the missing page from secondary storage, which can temporarily slow down processes due to latency. Despite this, demand paging optimizes the use of available memory, especially in systems with many concurrent processes, by reducing redundant storage of idle pages .

The Banker’s algorithm is a deadlock avoidance algorithm that tests the safety of resource allocation by simulating the allocation in advance. It determines if after receiving a resource request, the system can still allocate resources to all processes without leading to a deadlock. The algorithm calculates the needs of each process and checks whether existing resources plus resources to be released can satisfy these demands in some order. If this simulation finds such an order, the system is considered to be in a safe state. Otherwise, if no safe sequence can fulfill all processes’ maximum needs, the resource allocation request is denied .

The critical section problem occurs when multiple processes share a resource in such a way that their concurrent execution could lead to inconsistent outputs. A two-process solution to manage access involves using synchronization mechanisms like semaphores or locks to ensure mutual exclusion, allowing only one process to enter its critical section at a time. A simple solution involves each process checking if a shared variable (lock) is set to indicate if the resource is in use. The process sets the variable before entering the critical section and clears it upon exiting, ensuring that the other process waits its turn .

Deadlock prevention techniques involve strategies to ensure that at least one of the necessary conditions for deadlocks cannot hold. Two primary approaches are: 1. Resource ordering: By assigning a global order to all resource types and ensuring that each process requests resources in a pre-defined increasing order, circular waits can be eliminated. 2. Hold and wait prevention: This technique involves requesting all required resources at once and only initiating execution if all requests are satisfied, thus eliminating the condition where processes hold resources while waiting for others. Implementing such measures requires careful consideration of resource utilization patterns to avoid starvation and ensure efficiency .

Processes are independent execution units containing their own state information and memory space, whereas threads are subdivisions of a process that share resources such as memory space and file handles. Threads allow for efficient execution of concurrent operations within a single process, enhancing performance through parallelism and shared resources. This shared environment leads to efficient inter-thread communication but also demands proper synchronization to prevent race conditions. Processes require more overhead for context switching compared to threads but maintain greater execution isolation, reducing interference and fault propagation among concurrent tasks .

Monolithic architecture in operating systems involves a single-tier structure where all services run in kernel mode, sharing the same memory space. This can lead to efficiency in execution but also makes the system less secure and resilient to faults due to lack of modularization. Layered architecture, on the other hand, organizes the OS into a hierarchy of layers, where each layer provides services to the one above and uses services of the one below. This modular approach enhances error isolation and system security because each layer operates independently. However, this can introduce performance overhead due to context switching between layers .

Multiprogramming is a method where multiple programs reside in memory at the same time, sharing CPU resources. Its primary goal is to improve CPU utilization by organizing jobs so the CPU always has one to execute. However, it does not necessarily provide interactive user sessions. Multitasking, a form of multiprogramming, enhances this by allowing multiple tasks or processes to share CPU time and be performed simultaneously, significantly improving user interaction and system responsiveness. Multitasking requires better scheduling and more sophisticated memory management but optimizes CPU efficiency and user experience .

Context switching is the process whereby the CPU switches from executing one process to another, saving the state of the current process and loading the saved state of the next process. This is necessary for multitasking environments, allowing multiple processes to share the CPU efficiently. However, context switching introduces performance overhead because it involves loading and storing register states, updating the memory map, and possibly switching memory segments. The impact is a trade-off between improved multitasking and the processing time consumed by the switching itself, which can slow down overall system performance if it occurs too frequently .

Belady's anomaly refers to the counterintuitive occurrence where increasing the number of page frames results in an increase in the number of page faults. It typically occurs in certain page replacement algorithms like FIFO (First-In-First-Out) due to lack of information regarding how pages will be used in the future. When more frames are added, the algorithm may evict pages that would be used soon, causing more faults. This anomaly highlights the inefficiency of memory management methods that do not adapt to access patterns or prioritize recent or frequently used pages, contrasting with algorithms like LRU (Least Recently Used) that do not suffer from this problem .

You might also like