Found 2065 Articles for Operating System

Process vs Parent Process vs Child Process

Ricky Barnes
Updated on 24-Jun-2020 12:11:24

9K+ Views

In Operating System, the fork() system call is used by a process to create another process. The process that used the fork() system call is the parent process and process consequently created is known as the child process.Details about these are given as follows −ProcessA process is an active program i.e a program that is under execution. It is more than the program code as it includes the program counter, process stack, registers, program code etc. Compared to this, the program code is only the text section.A process changes its state as it executes. This state partially depends on the ... Read More

Process Deadlocks in Operating System

David Meador
Updated on 10-Sep-2023 07:42:33

39K+ Views

A deadlock happens in operating system when two or more processes need some resource to complete their execution that is held by the other process.In the above diagram, the process 1 has resource 1 and needs to acquire resource 2. Similarly process 2 has resource 2 and needs to acquire resource 1. Process 1 and process 2 are in deadlock as each of them needs the other’s resource to complete their execution but neither of them is willing to relinquish their resources.Coffman ConditionsA deadlock occurs if the four Coffman conditions hold true. But these conditions are not mutually exclusive.The Coffman ... Read More

Difference between Process and Thread

Kiran Kumar Panigrahi
Updated on 16-Dec-2022 10:41:44

47K+ Views

Both process and thread are related to each other and quite similar as these are the independent sequence of execution. The basic difference between a process and a thread is that a process takes place in different memory spaces, whereas a thread executes in the same memory space. Read through this article to find out how a process is different from a thread, in the context of operating systems. Let's start with some basics of threads and processes. What is a Process? A process is an active program, i.e., a program that is under execution. It is more ... Read More

Message Passing vs Shared Memory Process communication Models

Alex Onsman
Updated on 24-Jun-2020 11:56:48

3K+ Views

Message passing model and shared memory model are models of interprocess communication. Details about these are given as follows −Message Passing Process Communication ModelMessage passing model allows multiple processes to read and write data to the message queue without being connected to each other. Messages are stored on the queue until their recipient retrieves them. Message queues are quite useful for interprocess communication and are used by most operating systems.A diagram that demonstrates message passing model of process communication is given as follows −In the above diagram, both the processes P1 and P2 can access the message queue and store ... Read More

Race Condition, Critical Section and Semaphore

Ricky Barnes
Updated on 07-Nov-2023 13:13:31

32K+ Views

Race conditions, Critical Sections and Semaphores are an key part of Operating systems. Details about these are given as follows −Race ConditionA race condition is a situation that may occur inside a critical section. This happens when the result of multiple thread execution in critical section differs according to the order in which the threads execute.Race conditions in critical sections can be avoided if the critical section is treated as an atomic instruction. Also, proper thread synchronization using locks or atomic variables can prevent race conditions.Critical SectionThe critical section in a code segment where the shared variables can be accessed. ... Read More

Monitors vs Semaphores

David Meador
Updated on 24-Jun-2020 11:59:09

4K+ Views

Monitors and semaphores are used for process synchronization and allow processes to access the shared resources using mutual exclusion. However, monitors and semaphores contain many differences. Details about both of these are given as follows −MonitorsMonitors are a synchronization construct that were created to overcome the problems caused by semaphores such as timing errors.Monitors are abstract data types and contain shared data variables and procedures. The shared data variables cannot be directly accessed by a process and procedures are required to allow a single process to access the shared data variables at a time.This is demonstrated as follows:monitor monitorName { ... Read More

Starvation and Deadlock

Kristi Castro
Updated on 31-Jan-2020 10:20:36

6K+ Views

Starvation and Deadlock are situations that occur when the processes that require a resource are delayed for a long time. However they are quite different concepts.Details about starvation and deadlock are given as follows −StarvationStarvation occurs if a process is indefinitely postponed. This may happen if the process requires a resource for execution that it is never alloted or if the process is never provided the processor for some reason.Some of the common causes of starvation are as follows −If a process is never provided the resources it requires for execution because of faulty resource allocation decisions, then starvation can ... Read More

Multi-Threading Models

Alex Onsman
Updated on 24-Jun-2020 12:00:25

14K+ Views

Multithreading allows the execution of multiple parts of a program at the same time. These parts are known as threads and are lightweight processes available within the process. Therefore, multithreading leads to maximum utilization of the CPU by multitasking.The main models for multithreading are one to one model, many to one model and many to many model. Details about these are given as follows −One to One ModelThe one to one model maps each of the user threads to a kernel thread. This means that many threads can run in parallel on multiprocessors and other threads can run when one ... Read More

Mutex vs Semaphore

Ricky Barnes
Updated on 24-Jun-2020 12:01:12

27K+ Views

Mutex and Semaphore both provide synchronization services but they are not the same. Details about both Mutex and Semaphore are given below −MutexMutex is a mutual exclusion object that synchronizes access to a resource. It is created with a unique name at the start of a program. The Mutex is a locking mechanism that makes sure only one thread can acquire the Mutex at a time and enter the critical section. This thread only releases the Mutex when it exits the critical section.This is shown with the help of the following example −wait (mutex); ….. Critical Section ….. signal (mutex);A ... Read More

Semaphores in Operating System

David Meador
Updated on 29-Aug-2023 07:37:21

179K+ Views

Semaphores are integer variables that are used to solve the critical section problem by using two atomic operations, wait and signal that are used for process synchronization.The definitions of wait and signal are as follows −WaitThe wait operation decrements the value of its argument S, if it is positive. If S is negative or zero, then no operation is performed.wait(S) {    while (S

Advertisements