Operating Systems/Interprocess Communication Worked out Examples
Worked out Examples
7.1 What is disadvantage of pipes?
Ans:
The disadvantage of this type of IPC is that
a. they operate in one dimension only
b. they are useful when processes are schedulable and resident on
same machine
c. this is insecure mode of communication
d. pipes cannot support broadcast
7.2 What is reader writers problem in shared file type of interprocess
communication?
Ans:
In this problem if reader is faster than writer or writer is faster than reader than
problem is bound to creep in .if reader is faster than writer then it would try to
read the memory location which is not written by writer process. if writer is faster
than reader then it would just keep filling the buffers unboundedly. this problem is
reader. Writer problem in shared file IPC. So there is need for synchronization
between them.
7.3 Give breifly the various ways of establishing interprocess communication?
Ans:
1. Pipes: In this process a pipe is described which is essentially an
array that has two pointers, one is for input end and one for output.
In this it imperative that if one process writes it closes it ‘s reading
end and vice versa
2. Shared Files: one process identified as a writers process writes in
the file.Another process identified as readers file reads from this
file. Another way could be that instead of using files we can have
pointers . one process positions a pointer at the file location and
another process reads from this file at the communication location
3. Shared memory communication: in this one process writes into a
certain commonly accessed area and another process would read
P.C.P.Bhat/IISc Bangalore M7/V1/June 04/1
Operating Systems/Interprocess Communication Worked out Examples
subsequently from that area.
7.4 What are the properties inherited by a child process from parent process?
Ans:
1. Environment: all the variable=value pairs in the environment.
2. Process identifier: the new process gets his own process id
3. Parent process identifier : this is the spawning process’s id
4. Real and effective user identifier
5. Code
6. Data space
7. Stack
8. Signal and umask
9. Priority
P.C.P.Bhat/IISc Bangalore M7/V1/June 04/2