









Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Community
Ask the community for help and clear up your study doubts
Discover the best universities in your country according to Docsity users
Free resources
Download our free guides on studying techniques, anxiety management strategies, and thesis advice from Docsity tutors
An overview of process management within operating systems, focusing on deadlocks, their characterization, and various handling approaches. It covers necessary and sufficient conditions for deadlocks, including prevention, avoidance, detection, and recovery methods. The document also discusses concurrent and dependent processes, critical sections, semaphores, and inter-process communication methods. Classical process synchronization problems like the producer-consumer and reader-writer problems are explained, offering a comprehensive understanding of process synchronization and resource management in operating systems. It further explores process synchronization, concurrent processes, and the critical section problem, detailing requirements such as mutual exclusion, progress, and bounded waiting. Semaphores and inter-process communication methods, including pipes and shared memory, are also discussed, providing a thorough overview of process management concepts.
Typology: Study notes
1 / 16
This page cannot be seen from the preview
Don't miss anything!
1. What is Deadlock? Explain Deadlock Characterization? A process in operating system uses resources in the following way.
2. Explain methods/Approaches for Handling Deadlocks? A deadlock is a situation where a set of processes are blocked because each process is holding a resource and waiting for another resource acquired by some other process. For example, in the below diagram, Process 1 is holding Resource 1 and waiting for resource 2 which is acquired by process 2, and process 2 is waiting for resource 1. Methods for handling deadlock:
Advantages of concurrency
Critical Section problem must satisfy three requirements –
6. Write about Methods for Inter- process Communication? Inter-process communication: A mechanism which is used to provide communications among several processes is known as inter-process communication or IPC and it is provided by the OS or operating system. This type of communication is very helpful in data exchanging among several threads in single or multiple programs or processes which run on single or several computers connected through a network. There are different modes of inter-process communication like pipes, socket, file, signal, shared memory message queue & message passing. The working of IPC mainly depends on a few important methods or approaches which are discussed below. 1. Pipes A Pipe is one type of data channel, extensively used for communication in between two processes is unidirectional. 2. Socket This is the endpoint to transmit or receive data within a network. This is true for data transmitted between processes on a similar computer otherwise between various computers on a similar network. Sockets are used by most of the operating systems for IPC or interprocess communication.
3. File A file is a data record that is stored on a disk on demand through a file server. Several processes can access a file as necessary. All operating systems utilize files for storing data. 4. Signal The signal is very useful in IPC in a restricted way. They are system messages transmitted from one process to another. 5. Message Queues A linked list of messages is known as a message queue that is stored in the kernel. It can be simply recognized through a message queue identifier. So this technique provides communication in between single. Message Queue
In the above example, there are three processes, Process 1 is trying to write the shared data while Process 2 and Process 3 are trying to read the same data so there are huge changes in Process 2, and Process 3 might get the wrong data. Let’s understand some different sections of a program.
Semaphore empty=N, full=0, mutex=1; process producer { while (true) { empty.acquire( ); mutex.acquire( ); // produce mutex.release( ); full.release( ); } } process consumer { while (true) { full.acquire( ); mutex.acquire( ); // consume mutex.release( ); empty.release( ); } } The semaphore mutex provides mutual exclusion for access to the buffer
// protecting readerCount mutex.acquire( ); --readerCount; if (readerCount == 0) db.release; mutex.release( ); } readerCount is a
3. The Dining Philosophers Problem n philosophers sit around a table thinking and eating. When a philosopher thinks she does not interact with her colleagues. Periodically, a philosopher gets hungry and tries to pick up the chopstick on his left and on his right. A philosopher may only pick up one chopstick at a time and, obviously, cannot pick up a chopstick already in the hand of neighbor philosopher. The dining philosophers problems is an example of a large class or concurrency control problems; it is a simple representation of the need to allocate several resources among several processes in a deadlock-free and starvation-free manner.