+ All Categories
Home > Documents > Designed and Presented by Dr. Ayman Elshenawy … and Presented by Dr. Ayman Elshenawy Elsefy Dept....

Designed and Presented by Dr. Ayman Elshenawy … and Presented by Dr. Ayman Elshenawy Elsefy Dept....

Date post: 30-Mar-2018
Category:
Upload: tranbao
View: 216 times
Download: 0 times
Share this document with a friend
37
Designed and Presented by Dr. Ayman Elshenawy Elsefy Dept. of Systems & Computer Eng.. AL-AZHAR University Website : eaymanelshenawy.wordpress.com Email : [email protected] Reference Operating System Concepts, ABRAHAM SILBERSCHATZ Operating Systems
Transcript
Page 1: Designed and Presented by Dr. Ayman Elshenawy … and Presented by Dr. Ayman Elshenawy Elsefy Dept. of Systems & Computer Eng.. AL-AZHAR University Website : eaymanelshenawy.wordpress.com

Designed and Presented by

Dr. Ayman Elshenawy Elsefy

Dept. of Systems & Computer Eng..

AL-AZHAR University

Website : eaymanelshenawy.wordpress.com

Email : [email protected]

Reference

Operating System Concepts, ABRAHAM SILBERSCHATZ

Operating Systems

Page 2: Designed and Presented by Dr. Ayman Elshenawy … and Presented by Dr. Ayman Elshenawy Elsefy Dept. of Systems & Computer Eng.. AL-AZHAR University Website : eaymanelshenawy.wordpress.com

Chapter 3: Processes Management

•Process Concept

•Process Scheduling

•Operations on Processes

• Inter-process Communication

•Examples of IPC Systems

•Communication in Client-Server Systems

Objectives:

Page 3: Designed and Presented by Dr. Ayman Elshenawy … and Presented by Dr. Ayman Elshenawy Elsefy Dept. of Systems & Computer Eng.. AL-AZHAR University Website : eaymanelshenawy.wordpress.com

Process (Job) Concept• Single Process System (Single Task):

• Only one program allowed to be run at a time.

• This program had complete control of the system and all of it’s resources.

• Multi-programming:

• Multiple programs (user programs (User Code) and system programs (system code)) loaded into the memory and executed concurrently.

• The CPU (CPU’s) multiplexed among these Processes.

• A Single-user system can ran several programs at one time: a word processor, a Web browser, and an e-mail package.

• Even the user can execute only one program at a time, the OS have its own internal programmed activities, such as memory management.

• All these activities are called process or job.

• process execution must progress in sequential fashion

Page 4: Designed and Presented by Dr. Ayman Elshenawy … and Presented by Dr. Ayman Elshenawy Elsefy Dept. of Systems & Computer Eng.. AL-AZHAR University Website : eaymanelshenawy.wordpress.com

The Process• A process is a program in execution, consists of :

• Text Section: the program code that it execute.

• Program counter: the value of the current activity, andspecify the next instruction to be executed.

• Processor Registers' contents

• Process stack: Contains temporary data (such as functionparameters, return addresses, and local variables).

• Data section: Contains global variables.

• A heap: the dynamically allocated memory during run time.

• Program (passive entity, executable file), and becomes process ( active entity) when the executable file loaded into memory

• Execution of program started via:

• GUI by mouse clicks the icon of the executable file

• Command line entry of its name, etc.

• One program can be several processes (multiple users executing the same program).

Page 5: Designed and Presented by Dr. Ayman Elshenawy … and Presented by Dr. Ayman Elshenawy Elsefy Dept. of Systems & Computer Eng.. AL-AZHAR University Website : eaymanelshenawy.wordpress.com

The Process Status•As a process executes, it changes state

• New: The process is being created

• Running: Instructions of the process are being executed

• Waiting: The process is waiting for some event to occur (I/O Request)

• Ready: The process is waiting to be assigned to a processor

• Terminated: The process has finished execution

Diagram of Process State

Page 6: Designed and Presented by Dr. Ayman Elshenawy … and Presented by Dr. Ayman Elshenawy Elsefy Dept. of Systems & Computer Eng.. AL-AZHAR University Website : eaymanelshenawy.wordpress.com

Process Control Block (PCB)OS represent each Process by a PCB which have process

Information:

• Process state: the state may be new , ready , running , waiting

• Program counter: address of the next instruction to be executed

• CPU registers: The registers vary in number and type, depending on PC.

• CPU scheduling information: process priority and pointer to scheduling queues.

• Memory-management information: the value of the base and limit registers, page table.

• Accounting information: the amount of CPU and real time used, time limits, account numbers, job or process numbers, and so on.

• I/O status information: list of I/O devices allocated to the process, a list of open files, and so on.

Process Control Block (PCB)

Page 7: Designed and Presented by Dr. Ayman Elshenawy … and Presented by Dr. Ayman Elshenawy Elsefy Dept. of Systems & Computer Eng.. AL-AZHAR University Website : eaymanelshenawy.wordpress.com

Process Control Block (PCB)

CPU switch from Process to process

Page 8: Designed and Presented by Dr. Ayman Elshenawy … and Presented by Dr. Ayman Elshenawy Elsefy Dept. of Systems & Computer Eng.. AL-AZHAR University Website : eaymanelshenawy.wordpress.com

Process Representation in LinuxRepresented by the C structure

task_struct {pid_t pid; /* process identifier */

long state; /* state of the process */

unsigned int time_slice /* scheduling information */

struct task_struct *parent; /* process’s parent */

struct list_head children; /* process’s children */

struct files_struct *files; /* list of open files */

struct mm_struct *mm; /* address space of this pro */ }

• In Linux kernel, all active processes are stored in a doubly linked list of task_struct, and the kernel maintains a pointer —current—to the process currently executing on the system.

Page 9: Designed and Presented by Dr. Ayman Elshenawy … and Presented by Dr. Ayman Elshenawy Elsefy Dept. of Systems & Computer Eng.. AL-AZHAR University Website : eaymanelshenawy.wordpress.com

Process Scheduling

• In multi-programming there are more than one process running at thesame time, to maximize CPU utilization, quickly switch processes.

• The objective of time sharing is to switch the CPU among processes sofrequently that users can interact with each program while it is running.

• Process scheduler selects among a list of available processes for next execution on CPU, if the was a single processor one process is running at a time and the others must be wait.

• Maintains scheduling queues of processes

• Job queue – set of all created processes in the system

• Ready queue – set of all processes residing in main memory, ready and waiting to execute

• Device queues – set of processes waiting for an I/O device

• Processes migrate among the various queues

Page 10: Designed and Presented by Dr. Ayman Elshenawy … and Presented by Dr. Ayman Elshenawy Elsefy Dept. of Systems & Computer Eng.. AL-AZHAR University Website : eaymanelshenawy.wordpress.com

Ready Queue And Various I/O Device Queues

• The queue is stored as a linked list.

• A ready-queue header contains pointersto the first and final PCBs in the list.

• Each PCB have a pointer field to thenext PCB in the ready queue.

• When a process is allocated to the CPU,it executes for a time while it isinterrupted, or waits for I/O request(disk may be busy, The processtherefore may have to wait for the disk ).

• The processes entered in the devicequeue.

• Each device has its own device queue.

Page 11: Designed and Presented by Dr. Ayman Elshenawy … and Presented by Dr. Ayman Elshenawy Elsefy Dept. of Systems & Computer Eng.. AL-AZHAR University Website : eaymanelshenawy.wordpress.com

Representation of Process Scheduling• A new process is initially put

in the ready queue.

• It waits there until it isselected for execution

• Once the process is executed,one of several events couldoccur:

The process have an I/Orequest..

The process could create anew sub-process and wait forthe sub-process’s termination.

The process removed from theCPU, as a result of aninterrupt, and be put back inthe ready queue.

Page 12: Designed and Presented by Dr. Ayman Elshenawy … and Presented by Dr. Ayman Elshenawy Elsefy Dept. of Systems & Computer Eng.. AL-AZHAR University Website : eaymanelshenawy.wordpress.com

Schedulers• Scheduler: part of OS used to select process from scheduling queues to be

executed by the CPU in some fashion.

Long-term scheduler (or job scheduler) Short-term scheduler (or CPU scheduler)

Al list of processes are swapped to the

disk , and from the disk to the main

memory (ready queue)

Must Be Fast

controls the degree of

multiprogramming (how many process

in memory)

Invoked very infrequently (seconds,

minutes) (may be slow)

Select from the processes in the ready

queue (main memory), allocates the

CPU to one of them.

Must Be Fast to avoid wasting of time.

If it takes 10 ms to decide to execute a

process for 100 ms , then 10/(100 + 10)

= 9 percent of the CPU is being used

(wasted) simply for scheduling the

work.

Invoked very frequently (milliseconds)

• I/O-bound process : spends more of its time doing I/O than it spends doing computations.

• A CPU-bound process, spends more of its time doing computation than it spends doing I/O.

• The system with the best performance must have a combination of CPU-boundand I/O-bound.

Page 13: Designed and Presented by Dr. Ayman Elshenawy … and Presented by Dr. Ayman Elshenawy Elsefy Dept. of Systems & Computer Eng.. AL-AZHAR University Website : eaymanelshenawy.wordpress.com

Addition of Medium Term Scheduling• Swapping: to remove processes from memory and thus reduce the degree of

multiprogramming. Later, the process can be reentered into memory, and its

execution can be continued where it left off.

• The process is swapped out, and is later swapped in, by the medium-term

scheduler.

• Swapping may be necessary to improve the process mix good.

Page 14: Designed and Presented by Dr. Ayman Elshenawy … and Presented by Dr. Ayman Elshenawy Elsefy Dept. of Systems & Computer Eng.. AL-AZHAR University Website : eaymanelshenawy.wordpress.com

Context Switch• When an interrupt occurs the system needs to:

• Save the current context of the process running on the CPU

• Restore that context when its processing is done, (suspending/resuming).

• Context of a process represented in the PCB of the process.

• When CPU switches to another process, OS perform the following:

• State save : the system must save the state of the old process

• State restore: restore the saved state for the new process via a context switch

• Context-switch time is overhead; the system does no useful work while switching

• The more complex the OS and the PCB the longer the context switch

• Time dependent on hardware support

• Some hardware provides multiple sets of registers per CPU -> multiple contexts loaded at once

Page 15: Designed and Presented by Dr. Ayman Elshenawy … and Presented by Dr. Ayman Elshenawy Elsefy Dept. of Systems & Computer Eng.. AL-AZHAR University Website : eaymanelshenawy.wordpress.com

Operations on the Process: Process Creation

• Parent process can create a new processes while it is executed (childprocesses), which, in turn can create other processes (Process Tree)

• Each process is identified and managed via a process identifier (pid)

• Resource sharing Cases (CPU Time , Memory , Files ,I/O devices)• Parent and children share all resources

• Children share subset of parent’s resources

• Parent and child share no resources

• Execution Cases• Parent and children execute concurrently

• Parent waits until children terminate

• Address space• Child duplicate of parent

• Child has a program loaded into it

• UNIX examples• fork system call creates new process

• exec system call used after a fork to replace the process’ memory space with a newprogram

Page 16: Designed and Presented by Dr. Ayman Elshenawy … and Presented by Dr. Ayman Elshenawy Elsefy Dept. of Systems & Computer Eng.. AL-AZHAR University Website : eaymanelshenawy.wordpress.com

Operations on the Process: Process Creation Linux

#include <sys/types.h>

#include <studio.h>

#include <unistd.h>

int main()

{

int pid;

pid = fork(); /* fork another process */

if (pid < 0) { /* error occurred */

fprintf(stderr, "Fork Failed");

return 1;

}

else if (pid == 0) { /* child process */

execlp("/bin/ls", "ls", NULL);

}

else { /* parent process */

/* parent will wait for the child */

wait (NULL);

printf ("Child Complete");

}

return 0;

}

A Tree of Processes on Solaris

Page 17: Designed and Presented by Dr. Ayman Elshenawy … and Presented by Dr. Ayman Elshenawy Elsefy Dept. of Systems & Computer Eng.. AL-AZHAR University Website : eaymanelshenawy.wordpress.com

Operations on the Process: Process Creation Windows#include <stdio.h>

#include <windows.h>

int main(VOID)

{

STARTUPINFO si;

PROCESS_INFORMATION pi; // allocate memory

ZeroMemory(&si, sizeof(si));

si.cb = sizeof(si);

ZeroMemory(&pi, sizeof(pi)); // create child process

if (!CreateProcess(NULL, "C:\\WINDOWS\\system32\\mspaint.exe", NULL, NULL,

FALSE,0, NULL, NULL, &si, &pi)){

fprintf(stderr, "Create Process Failed");

return -1; } // parent will wait for the child to complete

WaitForSingleObject(pi.hProcess, INFINITE);

printf("Child Complete");

CloseHandle(pi.hProcess);

CloseHandle(pi.hThread);

} Creating a separate process using the Win32 API.

Page 18: Designed and Presented by Dr. Ayman Elshenawy … and Presented by Dr. Ayman Elshenawy Elsefy Dept. of Systems & Computer Eng.. AL-AZHAR University Website : eaymanelshenawy.wordpress.com

Operations on the Process: Process Creation Windows

Page 19: Designed and Presented by Dr. Ayman Elshenawy … and Presented by Dr. Ayman Elshenawy Elsefy Dept. of Systems & Computer Eng.. AL-AZHAR University Website : eaymanelshenawy.wordpress.com

Operations on the Process: Process Termination

• A process terminates when it finishes executing.

• The OS must delete it by using the exit() system call.

• Process may return a status value to its parent process (wait() system call).

• De-allocate all used resources.

• Termination can occur in other circumstances as well.

• A process can terminate another process by a suitable system call (TerminateProcess() in Win32). (Some times only parent process)

• Users could arbitrarily kill each other’s jobs.

• A parent may terminate the execution of one of its children for a variety of reasons, such as these:

• Child has exceeded allocated resources.

• The task assigned to the child is no longer required.

• The parent is exiting, and the OS does not allow a child to continue.

Page 20: Designed and Presented by Dr. Ayman Elshenawy … and Presented by Dr. Ayman Elshenawy Elsefy Dept. of Systems & Computer Eng.. AL-AZHAR University Website : eaymanelshenawy.wordpress.com

Inter Process Communication IPC• Processes executing concurrently in the OS may be:

• Reasons for cooperating processes:

• Information sharing: users interested in the same piece of information.

• Computation speedup: break it into subtasks (Parallel Run).

• Modularity: dividing the system functions into separate processes/threads.

• Convenience: user may work on many tasks at the same time.

• Cooperating processes need inter-process communication (IPC)

Independent Process Cooperating Process

• it cannot affect/affected by the other

processes executing in the system.

• It does no share of data with any

other process.

• it can affect/affected by the other

processes executing in the system.

• It shares data with other processes

is a cooperating process.

Page 21: Designed and Presented by Dr. Ayman Elshenawy … and Presented by Dr. Ayman Elshenawy Elsefy Dept. of Systems & Computer Eng.. AL-AZHAR University Website : eaymanelshenawy.wordpress.com

Inter Process Communication

• Shared memory: a region of

memory that is shared by

cooperating processes is

established, exchange information

by reading and writing data to the

shared region.

• Message passing: communication

takes place by means of messages

exchanged between the

cooperating processes.

Page 22: Designed and Presented by Dr. Ayman Elshenawy … and Presented by Dr. Ayman Elshenawy Elsefy Dept. of Systems & Computer Eng.. AL-AZHAR University Website : eaymanelshenawy.wordpress.com

Inter Process Communication – Shared Memory

• Communicated Processes establish a region of shared memory resides in theaddress space of the creating process.

• Other processes that wish to communicate using this shared-memory segmentmust attach it to their address space.

• The OS tries to prevent one process from accessing another process’s memory.

• Shared memory requires that two or more processes agree to remove thisrestriction.

• They can then exchange information by reading/writing data in the shared areas.

• The form of the data and the location are determined by these processes and arenot under the operating system’s control.

• The processes are also responsible for ensuring that they are not writing to thesame location simultaneously.

Page 23: Designed and Presented by Dr. Ayman Elshenawy … and Presented by Dr. Ayman Elshenawy Elsefy Dept. of Systems & Computer Eng.. AL-AZHAR University Website : eaymanelshenawy.wordpress.com

Producer-Consumer Problem• Producer process produces information that is consumed by a consumer

process

• a compiler produce assembly code that is consumed by an assembler.

• (Client-server) a web server produces HTML files and images, which areconsumed by the client web browser.

• Solution to allow producer and consumer processes to run concurrently

• We must have available a buffer of items:

• that can be filled by the producer and emptied by the consumer.

• This buffer a region of shared memory between the producer and consumer.

• A producer can produce one item while the consumer is consuming another item.

• The producer and consumer must be synchronized.

• unbounded-buffer places no practical limit on the size of the buffer

• bounded-buffer assumes that there is a fixed buffer size

Page 24: Designed and Presented by Dr. Ayman Elshenawy … and Presented by Dr. Ayman Elshenawy Elsefy Dept. of Systems & Computer Eng.. AL-AZHAR University Website : eaymanelshenawy.wordpress.com

Producer-Consumer Problem – Bounded Buffer

Page 25: Designed and Presented by Dr. Ayman Elshenawy … and Presented by Dr. Ayman Elshenawy Elsefy Dept. of Systems & Computer Eng.. AL-AZHAR University Website : eaymanelshenawy.wordpress.com

Producer-Consumer Problem – Using Java

Page 26: Designed and Presented by Dr. Ayman Elshenawy … and Presented by Dr. Ayman Elshenawy Elsefy Dept. of Systems & Computer Eng.. AL-AZHAR University Website : eaymanelshenawy.wordpress.com

Inter-process Communication – Message Passing• Allow processes to communicate and to synchronize their actions Using

Messages.

• Useful in a distributed environment, the communicating processes mayreside on different computers connected by a network.

• A chat program on the WWW could be designed so that chat participantscommunicate with one another by exchanging messages.

• A message-passing facility provides at least two operations:

• send(message) – message size fixed or variable

• receive(message)

• If P and Q wish to communicate, they need to:

• establish a communication link between them

• exchange messages via send/receive

• Implementation of communication link

• physical (e.g., shared memory, hardware bus, or network)

• logical (e.g., logical properties)

Page 27: Designed and Presented by Dr. Ayman Elshenawy … and Presented by Dr. Ayman Elshenawy Elsefy Dept. of Systems & Computer Eng.. AL-AZHAR University Website : eaymanelshenawy.wordpress.com

Implementation Questions

• How are links established?

• Can a link be associated with more than two processes?

• How many links can there be between every pair of communicating processes?

• What is the capacity of a link?

• Is the size of a message that the link can accommodate fixed or variable?

• Is a link unidirectional or bi-directional?

Page 28: Designed and Presented by Dr. Ayman Elshenawy … and Presented by Dr. Ayman Elshenawy Elsefy Dept. of Systems & Computer Eng.. AL-AZHAR University Website : eaymanelshenawy.wordpress.com

Direct Communication

•Processes must name each other explicitly:

• send (P, message) – send a message to process P

• receive(Q, message) – receive a message from process Q

•Properties of communication link

• Links are established automatically

• A link is associated with exactly one pair of communicating processes

• Between each pair there exists exactly one link

• The link may be unidirectional, but is usually bi-directional

Page 29: Designed and Presented by Dr. Ayman Elshenawy … and Presented by Dr. Ayman Elshenawy Elsefy Dept. of Systems & Computer Eng.. AL-AZHAR University Website : eaymanelshenawy.wordpress.com

In-Direct Communication• Messages are directed and received from mailboxes (also referred to as ports)

• Each mailbox has a unique id , Processes can communicate only if they share a mailbox

• Properties of communication link• Link established only if processes share a common mailbox• A link may be associated with many processes• Each pair of processes may share several communication links• Link may be unidirectional or bi-directional

• Operations• create a new mailbox - send and receive messages through mailbox - destroy a mailbox

• Primitives are defined as:• send(A, message) – send a message to mailbox A , • receive(A, message) – receive a message from mailbox A

• Mailbox sharing• P1, P2, and P3 share mailbox A• P1, sends; P2 and P3 receive• Who gets the message?

• Solutions• Allow a link to be associated with at most two processes• Allow only one process at a time to execute a receive operation• Allow the system to select the receiver. Sender is notified who the receiver was.

Page 30: Designed and Presented by Dr. Ayman Elshenawy … and Presented by Dr. Ayman Elshenawy Elsefy Dept. of Systems & Computer Eng.. AL-AZHAR University Website : eaymanelshenawy.wordpress.com

Synchronization• Message passing may be either blocking or non-blocking

• Blocking is considered synchronous

• Blocking send has the sender block until the message is received

• Blocking receive has the receiver block until a message is available

• Non-blocking is considered asynchronous

• Non-blocking send: The sending process sends the message and resumes operation.

• Non-blocking receive: The receiver retrieves either a valid message or a null.

• messages exchanged by communicating processes reside in a temporary queue. Basically, such queues can be implemented in three ways:

1. Zero capacity – 0 messagesThe queue has a maximum length of zero; thus, the link cannot have any messages waiting in it. In this case, the sender must block until the recipient receives the message.

2. Bounded capacity – finite length of n messages• The queue has finite length n; thus, at most n messages can reside in it. • If the queue is not full, the sender can continue execution without waiting. • If the link is full, the sender must block until space is available in the queue.

3. Unbounded capacity – infinite length an number of message can wait on the link, the Sender never waits

Buffering

Page 31: Designed and Presented by Dr. Ayman Elshenawy … and Presented by Dr. Ayman Elshenawy Elsefy Dept. of Systems & Computer Eng.. AL-AZHAR University Website : eaymanelshenawy.wordpress.com

Examples of IPC Systems - POSIX• POSIX Shared Memory

• Process first creates shared memory segment

segment id = shmget(IPC PRIVATE, size, S IRUSR | S IWUSR);

• Process wanting access to that shared memory must attach to it

shared memory = (char *) shmat(id, NULL, 0);

• Now the process could write to the shared memory

sprintf(shared memory, "Writing to shared memory");

• When done a process can detach the shared memory from its address space

shmdt(shared memory);

• Mach communication is message based

• Even system calls are messages

• Each task gets two mailboxes at creation- Kernel and Notify

• Only three system calls needed for message transfer

msg_send(), msg_receive(), msg_rpc()

• Mailboxes needed for commuication, created via

port_allocate()

Page 32: Designed and Presented by Dr. Ayman Elshenawy … and Presented by Dr. Ayman Elshenawy Elsefy Dept. of Systems & Computer Eng.. AL-AZHAR University Website : eaymanelshenawy.wordpress.com

Examples of IPC Systems - POSIX• Message-passing centric via local procedure call (LPC) facility

• Only works between processes on the same system

• Uses ports (like mailboxes) to establish and maintain communication channels

• Communication works as follows:• The client opens a handle to the subsystem’s connection port object.

• The client sends a connection request.

• The server creates two private communication ports and returns the handle to one of them to the client.

• The client and server use the corresponding port handle to send messages or callbacks and to listen for replies.

Page 33: Designed and Presented by Dr. Ayman Elshenawy … and Presented by Dr. Ayman Elshenawy Elsefy Dept. of Systems & Computer Eng.. AL-AZHAR University Website : eaymanelshenawy.wordpress.com

1. Sockets• A socket is defined as an endpoint for communication

• Concatenation of IP address and port

• The socket 161.25.19.8:1625 refers to port 1625 on host 161.25.19.8

• Communication consists between a pair of sockets

Communications in Client-Server Systems

• The server waits for incoming client requests

by listening to a specified port.

• Once a request is received, the server accepts

a connection from the client socket to

complete the connection.

• Servers implementing specific services listen

to well-known ports (a telnet server listens to

port 23; an FTP server listens to port 21; and a

Web, or HTTP, server listens to port 80).

Page 34: Designed and Presented by Dr. Ayman Elshenawy … and Presented by Dr. Ayman Elshenawy Elsefy Dept. of Systems & Computer Eng.. AL-AZHAR University Website : eaymanelshenawy.wordpress.com

Communications in Client-Server Systems2. Remote procedure call (RPC)

• RPC between processes on networked systems

• Stubs – client-side proxy for the actual procedure on the server

• The client-side stub locates the server and marshalls the parameters

• The server-side stub receives this message, unpacks the marshalled parameters, and performs the procedure on the server

Execution of RPC

Page 35: Designed and Presented by Dr. Ayman Elshenawy … and Presented by Dr. Ayman Elshenawy Elsefy Dept. of Systems & Computer Eng.. AL-AZHAR University Website : eaymanelshenawy.wordpress.com

Communications in Client-Server Systems3. Pipes : Acts as a tube allowing two processes to communicate

• Issues

• Is communication unidirectional or bidirectional?

• Must there exist a relationship (i.e. parent-child) between the communicating processes?

• Can the pipes be used over a network?

• Ordinary Pipes

• allow communication in standard producer-consumer style

• Producer writes to one end (the write-end of the pipe)

• Consumer reads from the other end (the read-end of the pipe)

• Ordinary pipes are therefore unidirectional

• Require parent-child relationship between communicating processes

Page 36: Designed and Presented by Dr. Ayman Elshenawy … and Presented by Dr. Ayman Elshenawy Elsefy Dept. of Systems & Computer Eng.. AL-AZHAR University Website : eaymanelshenawy.wordpress.com

Communications in Client-Server Systems

4. Named Pipes

•Named Pipes are more powerful than ordinary pipes• Communication is bidirectional

• No parent-child relationship is necessary between the communicating processes

• Several processes can use the named pipe for communication

• Provided on both UNIX and Windows systems

Page 37: Designed and Presented by Dr. Ayman Elshenawy … and Presented by Dr. Ayman Elshenawy Elsefy Dept. of Systems & Computer Eng.. AL-AZHAR University Website : eaymanelshenawy.wordpress.com

End of Chapter 3


Recommended