Found 1301 Articles for MCA

Major issues with Multi-threaded Programs

Kristi Castro
Updated on 31-Jan-2020 10:24:32

6K+ Views

Multithreaded programs allow 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.Threads improve the application performance using parallelism. They share information like data segment, code segment files etc. with their peer threads while they contain their own registers, stack, counter etc.Some of the issues with multithreaded programs are as follows −Let us see them one by one −Increased Complexity − Multithreaded processes are quite complicated. Coding for these can only be handled by expert programmers.Complications due to Concurrency − It is difficult to ... Read More

Priority Inversion

Ricky Barnes
Updated on 31-Jan-2020 10:27:54

8K+ Views

Priority inversion is a operating system scenario in which a higher priority process is preempted by a lower priority process. This implies the inversion of the priorities of the two processes.Problems due to Priority InversionSome of the problems that occur due to priority inversion are given as follows −A system malfunction may occur if a high priority process is not provided the required resources.Priority inversion may also lead to implementation of corrective measures. These may include the resetting of the entire system.The performance of the system can be reduces due to priority inversion. This may happen because it is imperative ... Read More

Single-threaded and Multi-threaded Processes

David Meador
Updated on 31-Jan-2020 10:30:07

39K+ Views

Single threaded processes contain the execution of instructions in a single sequence. In other words, one command is processes at a time.The opposite of single threaded processes are multithreaded processes. These processes allow the execution of multiple parts of a program at the same time. These are lightweight processes available within the process.Multithreaded Processes ImplementationMultithreaded processes can be implemented as user-level threads or kernel-level threads. Details about these are provided using the following diagram −User-level ThreadsThe user-level threads are implemented by users and the kernel is not aware of the existence of these threads. It handles them as if they ... Read More

Methods for Handling Deadlocks

Kristi Castro
Updated on 24-Jun-2020 12:06:06

12K+ Views

Deadlock detection, deadlock prevention and deadlock avoidance are the main methods for handling deadlocks. Details about these are given as follows −Deadlock DetectionDeadlock can be detected by the resource scheduler as it keeps track of all the resources that are allocated to different processes. After a deadlock is detected, it can be handed using the given methods −All the processes that are involved in the deadlock are terminated. This approach is not that useful as all the progress made by the processes is destroyed.Resources can be preempted from some processes and given to others until the deadlock situation is resolved.Deadlock ... Read More

Deadlock Characterization

Alex Onsman
Updated on 06-Sep-2023 11:21:29

59K+ 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.A deadlock occurs if the four Coffman conditions hold true. But these conditions are not mutually exclusive. They are given as follows −Mutual ExclusionThere should be a resource that can only be held by one process at a time. In the diagram below, there is a single instance of Resource 1 and it is held by Process 1 only.Hold and WaitA process can hold multiple resources and still request more resources from other processes which are ... Read More

Cooperating Process

Ricky Barnes
Updated on 24-Jun-2020 12:08:59

8K+ Views

Cooperating processes are those that can affect or are affected by other processes running on the system. Cooperating processes may share data with each other.Reasons for needing cooperating processesThere may be many reasons for the requirement of cooperating processes. Some of these are given as follows −ModularityModularity involves dividing complicated tasks into smaller subtasks. These subtasks can completed by different cooperating processes. This leads to faster and more efficient completion of the required tasks.Information SharingSharing of information between multiple processes can be accomplished using cooperating processes. This may include access to the same files. A mechanism is required so that ... Read More

Process Scheduling Fundamentals

David Meador
Updated on 31-Jan-2020 10:37:20

531 Views

Process Scheduling handles the selection of a process for the processor on the basis of a scheduling algorithm and also the removal of a process from the processor. It is an important part of multiprogramming in operating system.Process Scheduling AlgorithmsProcess scheduling algorithms are used to handle the selection of a process for the processor or distribute resources maong processes.Some of the process scheduling algorithms are given as follows −First Come First ServedThis algorithm handles the processes in the order they arrive in the ready queue. FCFS is the simplest scheduling algorithm. There is no preemption in FCFS and so no ... Read More

Zombie vs Orphan vs Daemon Processes

Kristi Castro
Updated on 31-Jan-2020 10:39:05

4K+ Views

Details about the zombie, orphan and daemon processes are given as follows −Zombie ProcessesA zombie process is a process whose execution is completed but it still has an entry in the process table. Zombie processes usually occur for child processes, as the parent process still needs to read its child’s exit status. Once this is done using the wait system call, the zombie process is eliminated from the process table. This is known as reaping the zombie process.A diagram that demonstrates the creation and termination of a zombie process is given as follows −Zombie processes don't use any system resources ... Read More

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

Advertisements