Found 690 Articles for Computer Science

What is bus arbitration in computer organization?

yashwanth sitamraju
Updated on 30-Jul-2019 22:30:24

18K+ Views

What is Bus Arbitration?A device that initiates data transfers on the bus at any given time is called a bus master.In a computer system, there may be more than one bus master such as a DMA controller or a processor etc.These devices share the system bus and when a current master bus relinquishes another bus can acquire the control of the processor.Bus arbitration is a process by which next device becomes the bus controller by transferring bus mastership to another bus.Types of Bus ArbitrationThere are two types of bus arbitration namelyCentralised Arbitration.Distributed Arbitration.Only single bus arbiter performs the required arbitration ... Read More

Dining Philosophers Problem (DPP)

Kristi Castro
Updated on 24-Jun-2020 12:16:40

38K+ Views

The dining philosophers problem states that there are 5 philosophers sharing a circular table and they eat and think alternatively. There is a bowl of rice for each of the philosophers and 5 chopsticks. A philosopher needs both their right and left chopstick to eat. A hungry philosopher may only eat if there are both chopsticks available.Otherwise a philosopher puts down their chopstick and begin thinking again.The dining philosopher is a classic synchronization problem as it demonstrates a large class of concurrency control problems.Solution of Dining Philosophers ProblemA solution of the Dining Philosophers Problem is to use a semaphore to ... Read More

Producer Consumer Problem using Semaphores

Alex Onsman
Updated on 24-Jun-2020 12:17:41

25K+ Views

The producer consumer problem is a synchronization problem. There is a fixed size buffer and the producer produces items and enters them into the buffer. The consumer removes the items from the buffer and consumes them.A producer should not produce items into the buffer when the consumer is consuming an item from the buffer and vice versa. So the buffer should only be accessed by the producer or consumer at a time.The producer consumer problem can be resolved using semaphores. The codes for the producer and consumer process are given as follows −Producer ProcessThe code that defines the producer process ... Read More

Readers-Writers Problem

Ricky Barnes
Updated on 07-Nov-2023 03:56:28

49K+ Views

The readers-writers problem relates to an object such as a file that is shared between multiple processes. Some of these processes are readers i.e. they only want to read the data from the object and some of the processes are writers i.e. they want to write into the object.The readers-writers problem is used to manage synchronization so that there are no problems with the object data. For example - If two readers access the object at the same time there is no problem. However if two writers or a reader and writer access the object at the same time, there ... Read More

Process Synchronization in Linux

Kristi Castro
Updated on 24-Jun-2020 12:19:48

4K+ Views

Process synchronization in Linux involves providing a time slice for each process so that they get the required time for execution.The process can be created using the fork() command in Linux. The creating process is called the parent process and the created process is the child process. A child process can have only one parent but a parent process may have many children. Both the parent and child processes have the same memory image, open files and environment strings. However, they have distinct address spaces.A diagram that demonstrates the fork() command is given as follows −Orphan ProcessesThere are some processes ... Read More

Remote Procedure Call (RPC)

Alex Onsman
Updated on 01-Nov-2023 14:47:32

36K+ Views

A remote procedure call is an interprocess communication technique that is used for client-server based applications. It is also known as a subroutine call or a function call.A client has a request message that the RPC translates and sends to the server. This request may be a procedure or a function call to a remote server. When the server receives the request, it sends the required response back to the client. The client is blocked while the server is processing the call and only resumed execution after the server is finished.The sequence of events in a remote procedure call are ... Read More

Operating Systems Client/Server Communication

Ricky Barnes
Updated on 24-Jun-2020 12:22:35

18K+ Views

Client/Server communication involves two components, namely a client and a server. They are usually multiple clients in communication with a single server. The clients send requests to the server and the server responds to the client requests.There are three main methods to client/server communication. These are given as follows −SocketsSockets facilitate communication between two processes on the same machine or different machines. They are used in a client/server framework and consist of the IP address and port number. Many application protocols use sockets for data connection and data transfer between a client and a server.Socket communication is quite low-level as ... Read More

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

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

Advertisements