Subscribe to our RSS Feeds

Inter-Process Communication

3 Comments »

Inter-Process Communication

A mechanism through which data is shared among the process in the system is referred to as Inter-process communication. Multiple processes communicate with each other to share data and resources. A set of functions is required for the communication of process with each other. In multiprogramming systems, some common storage is used where process can share data. The shared storage may be the main memory or it may be a shared file. Files are the most commonly used mechanism for data sharing between processes. One process can write in the file while another process cam read the data for the same file.
Various techniques can be used to implement the Inter-Process Communication. There are two fundamental models of Inter-Process communication that are commonly used, these are:
1. Shared Memory Model
2. Message Passing Model
·        Shared Memory Model
In shared memory model. The co operating process shares a region of memory for sharing of information. Some operating systems use the supervisor call to create a share memory space. Similarly, Some operating system use file system to create RAM disk, which is a virtual disk created in the RAM. The shared files are stored in RAM disk to share the information between processes. The shared files in RAM disk are actually stored in the memory. The Process can share information by writing and reading data to the shared memory location or RAM disk.
·        Message Passing Model
In this model, data is shared between process by passing and receiving messages between co-operating process. Message passing mechanism is easier to implement than shared memory but it is useful for exchanging smaller amount of data. In message passing mechanism data is exchange between processes through kernel of operating system using system calls. Message passing mechanism is particularly useful in a distributed environment where the communicating processes may reside on different components connected by the network. For example, A data program used on the internet could be designed so that chat participants communicate with each other by exchanging messages. It must be noted that passing message technique is slower than shared memory technique.
  • A message contains the following information:
  • Header of message that identifies the sending and receiving processes
  • Block of data
  • Pointer to block of data
  • Some control information about the process
Typically Inter-Process Communication is based on the ports associated with process. A port represent a queue of processes. Ports are controlled and managed by the kernel. The processes communicate with each other through kernel.
In message passing mechanism, two operations are performed. Theses are sending message and receiving message. The function send() and receive() are used to implement these operations. Supposed P1 and P2 want to communicate with each other. A communication link must be created between them to send and receive messages. The communication link can be created using different ways. The most important methods are:
  1. Direct model
  2. Indirect model
  3. Buffering   
7:46 PM

Process Control Block

1 Comments »

Process Control Block

The data structure that stores information about a process is called a Process Control Block (PCB). In a computer system, each process is represented by a Process Control Block (PCB). It is also referred to as Task Control Block. The PCB contain the information about the process. It is the central store of information that allows the operating system to locate all the key information about a process. When CPU switches from one process to another, the operating system uses the Process Control Block (PCB) to save the state of process and uses these information when control returns back process is terminated, the Process Control Block (PCB) released from the memory. The information stored in the Process Control Block in given below
Process State
It indicates the information about the state of process such as blocked ready running etc.
Process ID
Each process is assigned a unique identification number, when it is entered into the system.
Program Counter
It indicates the address of the next instruction to be executed.
CPU Registers
It indicates the information about the contents of the CPU registers. The information of CPU registers must be saved when an interrupt occurs, so that the process can be continued correctly afterward. Registers hold the processed the result of calculations or addresses pointing to the memory locations of desired data.
CPU Scheduling Information
It indicates the information needed for CPU scheduling such as process priority, pointers to scheduling queues and other scheduling parameters.
Memory Management Information
It indicates the information needed for memory management such as value of the base and limit registers, page tables or segment tables, amount of memory units allocated to the process etc.
Accounting Information
It indicates the information about process number, CPU used by the process time limits etc.
I/O Status Information
It indicates the information about I/O devices allocated to the process a list of open files access rights of files opened and so on,
Link to Parent Process
A new process can be created from existing process; the existing process is called the parent process of the newly created process. The address of the PCB of parent process is stored.
Link to Child Process
The addresses of the PCBs of the child processes in the main memory are stored.
6:14 PM