Inter Process Communication (Ipc) Essay

2495 words - 10 pages

1. Inter-process Communication (IPC)
Introduction
Inter-Process Communication, which in short is known as IPC, deals mainly with the techniques and mechanisms that facilitate communication between processes. Now, why do we need special separate mechanisms or techniques for communicating between processes? Why isn't it possible to have information shared between two processes without using such special mechanisms?
Let us start from something primitive. Imagine you have two glasses completely filled with water. One glass contains hot water and the other contains cold water. What can you do to make the temperature of water in both the glasses equal? The simplest answer will be to mix the ...view middle of the document...

Similar to our earlier example, where the glass with hot water is one process address space, the glass with cold water is another, and the glass with the larger capacity is the kernel address space, so that we pour both hot water and cold water into the glass with larger capacity.
What next? There are different IPC mechanisms which come into use based on the different requirements. In terms of our water glasses, we can determine the specifics of both pouring the water into the larger glass and how it will be used after begin poured.
The IPC mechanisms can be classified into the following categories as given below:
a. pipes
b. fifos
c. message queues
d. Semaphores

A. Pipes
Pipes were evolved in the most primitive forms of the Unix operating system. They provide unidirectional flow of communication between processes within the same system. In other words, they are half-duplex, that is, data flows in only one direction. A pipe is created by invoking the pipe system call, which creates a pair of file descriptors. These descriptors point to a pipe inode and the file descriptors are returned through the filedes argument. In the file descriptor pair, filedes[0] is used for reading whereas filedes[1] is used for writing.
Let me explain a scenario where we can use the pipe system call: consider a keyboard-reader program which simply exits after any alpha-numeric character is pressed on the keyboard. We will create two processes; one of them will read characters from the keyboard, and the other will continuously check for alpha-numeric characters. Let us see how the filedes returned by pipe can be of use in this scenario:
#include
#include
#include
#include
#include
#include

int filedes[2];

void *read_char()
{
char c;
printf("Entering routine to read character.........\n");
while(1) {
/* Get a character in 'c' except '\n'. */
c = getchar();
if(c == '\n')
c = getchar();
write(filedes[1], &c, 1);
if(isalnum(c)) {
sleep(2);
exit(1);
}
}
}

void *check_hit()
{
char c;
printf("Entering routine to check hit.........\n");
while(1) {
read(filedes[0], &c, 1);
if(isalnum(c)) {
printf("The key hit is %c\n", c);
exit(1);
} else {
printf("key hit is %c\n", c);
}
}
}

int main()
{
int i;
pthread_t tid1, tid2;
pipe(filedes);
/* Create thread for reading characters. */
i = pthread_create(&tid1, NULL, read_char, NULL);
/* Create thread for checking hitting of any keyboard key. */
i = pthread_create(&tid2, NULL, check_hit, NULL);
if(i == 0) while(1);
return 0;
}
The read_char function simply reads a character other than '\n' from the keyboard and writes it to filedes[1]. We have the thread check_hit, which continuously checks for the character in filedes[0]. If the character in filedes[0] is an alpha-numeric character, then the character is printed and the program terminates.
One major feature of pipe is that the data flowing through...

Other Essays Like Inter-Process Communication (Ipc)

Establishing a Workforce Plan for a Proposed Integrated Health and Social Care Service in a North London Borough

2222 words - 9 pages consultancy topic. This consultancy project aims to establish for the proposed integrated care service, a hypothetical short term (1-2 years) Workforce plan (WP). The plan will be linked to both organizations strategies for integrated care. Reilly (1996), defined WP as a process in which an organisation attempts to estimate the demand for labour and evaluate the size, nature and sources of supply which will be required to meet that demand

The Psychological Contract Essay

2111 words - 9 pages courses for employee to develop their individual education and skill. Issue in the Raffles merger The first is the communication process issue. After acquiring the Swissotel hotel Company, the issue of communication process appeared when previous Swissotel staff members were integrated into the Raffles. Different cultural background and business practice can create sensitivity and should be considered in the communication process. Different

Human Rights

1734 words - 7 pages , cultural or ethnic background. Inalienable: because people’s rights can never be taken away except in specific situations and according to due process. For example, the right to liberty may be restricted if a person is found guilty of a crime by a court of law. Indivisibility: Human rights are indivisible. Whether they relate to civil, cultural, economic, political or social issues, human rights are inherent to the dignity of every human person

Mgt 501 Mgmt. and Org. Behavior

887 words - 4 pages party perceives that its interests are being opposed or negatively affected by another party. How can this process be done? There are different categories that can make a person have opposition. These categories are inter-personal, intergroup, and interorganizational. Conflict is a part of most every interpersonal relationship. Therefore, it is very important if the relationship is to be long-lasting and rewarding to learn how to manage

Describe The Following Barriers Which Managers Face And Briefly Recommend How They Might Best Be Overcome: (I) Barriers To Communication (Ii) Barriers To Change

808 words - 4 pages (i) Communication is the activity whereby an individual or group conveys,consciously or unconsciously, information, feelings or ideas to another individual or group, and where necessary evokes a discriminating response.Barriers can arise at any stage of the communication process or include 'noise' in the general environment.The barrier may arise out of skill deficiencies in the transmitter and/or the receiver since communication cannot be

Cpmgt 301 Week 2 Team Paper

759 words - 4 pages of non-project based organizational structure is the functional model, and this is where an owner or manager oversees many different department heads, each of whom runs one specific department in which a certain function is performed.   Communication differs from a project-based organization versus a non- project-based organization because project-based organizations inter-organizational communication requirements are higher than a non-project

Market Plan Mkt5125

5533 words - 23 pages response. The better the customer service, the greater the amount of profits to be, and this is evidenced in Regional Rental's positive growth since inception. This process has a long-term value orientation. Performance metrics will be pulled on a weekly basis and reviewed monthly basis. Key performance indicators are: • Regional Service Quality Index (RSQI) • Days Earned • Income per car (IPC) • Net other The RSQI - Regional Service Quality

Introduction to Project Managementcourse

1339 words - 6 pages  Skill shortfalls  Poor procedures  Unclear roles and responsibilities Defenses Against Dysfunction  Effective Project Communications  Stakeholder Assessment  Communication Management Plan  Specific communication risk management  Team Development  Defined process  Collaboration focus Foundation ConceptsModule Name 17 Introduction to Project ManagementCourse Name IIL-IPMIIL-XXX Communications Management Plan

Level 5 Management

5215 words - 21 pages noisy, cold, areas are well light and inviting, garish colours or over patterned walls are avoided, seating arranged appropriately, any signage visible etc. Communication is not only a verbal process and observing an individuals facial expressions and body language are very effective tools in interpreting the needs of the individual. In order to minimise any barriers, speak clearly and slowly, explain carefully and check understanding. Give

Scope of Management

1729 words - 7 pages job performance and geared toward the employees' needs. Effective communication is vital in maintaining a productive working environment, building positive interpersonal relationships, and problem solving. Understanding the communication process and working on areas that need improvement help managers to become more effective communicators. The best way to find areas that need improvement is to periodically ask themselves and others how well they

Human Services Organizations

1694 words - 7 pages ; establish communication, develop a shared vision, and establish permanence through trust (Gary 1985, 1990).  When looking for new partners there has to be some form of communication with organizations that can help met goals respects the agencies mission, vision, and has similar objectives. The organization has to develop a common cognitive structure as well. Without this step, participants will lack a common definition of the problem to be addressed

Related Papers

Judicial Process As An Instrument Of Social Ordering

1929 words - 8 pages Process In "Lata Singh v. State of U. P.", AIR 2006 SC 2522, the Apex Court has given protection to the major boy and girl who have solemnized inter-caste or inter-religious marriage. Child Labour In "M.C. Mehta v. State of T.N.", AIR 1997 S C 699, the Supreme Court has issued direction the State Governments to ensure fulfillment of legislative intention behind the Child Labour (Prohibition and Regulation) Act (61 of 1986). Tackling the

Simply Assignment

918 words - 4 pages kind of products deserve the customers and everything that customers should know about the products. Marketers are allowed to make relationship with customers in several ways. (Keller 2001) Understanding Integrated Marketing Communication Programs Integrated Marketing Communication is defined as a strategic business process, used to develop, execute, convincing brand communication programs, relate to external and internal customers (Schultz

He Says, She Says: A Synthesis

1349 words - 6 pages concerning inter-gender relations and addresses the issue of differing reasoning resulting in misunderstanding. Tannen describes differences between male and female communication skills as a series of predetermined thought patterns. She states that men and women simply have a different way of going about communication. She believes that different ways of communicating stem from differing desired results of the conversation at hand. A married

Communication And Crisis Essay

1117 words - 5 pages each team member. The Public Relations department of the agency is also essential in the inter-departmental communication process. They should be notified of the crisis situation. Their task will then be to serve as initial communication agent to the public via the press. Receiving information about a biological contaminant in the water supply of several towns is not news that is likely to remain secret for long. Since the agency is in