Unit6 - Subjective Questions

CSE325 • Practice Questions with Detailed Answers

1

Define Inter-Process Communication (IPC). List and briefly explain three common IPC mechanisms supported by UNIX/Linux systems.

2

Explain the pipe() system call with its syntax and return values. Describe the role of the file descriptors generated.

3

Differentiate between Unnamed Pipes and Named FIFOs.

4

Describe the implementation of a Parent-Child communication system using an unnamed pipe where the parent writes a message and the child reads it. Include the necessary system call logic.

5

Why is Shared Memory considered the fastest IPC mechanism? Explain the concept.

6

Explain the mkfifo() system call. How is it different from the standard open() call?

7

Detailed the syntax and usage of the shmget() system call. What is the significance of the IPC_CREAT flag?

8

Explain how processes attach and detach shared memory segments using shmat() and shmdt(). Provide their syntax.

9

Derive the logic to implement full-duplex (two-way) communication between a parent and a child process using pipes.

10

Discuss the shmctl() system call. How is it used to remove a shared memory segment?

11

What happens if a process attempts to read from a pipe that is empty? What happens if it writes to a pipe that is full?

12

Compare Shared Memory and Message Passing (Pipes/Queues) in terms of implementation complexity and performance.

13

Describe the standard workflow for two unrelated processes to communicate using a Named FIFO.

14

What is a Race Condition in the context of Shared Memory? How can it be prevented?

15

Explain the significance of ftok() in System V IPC (Shared Memory).

16

Develop a C program snippet to read a string from the user in a parent process and send it to the child process using a pipe. The child should print the received string.

17

Why is it important to close unused file descriptors in a pipe based implementation? What happens if the write end is not closed by the reader process?

18

Discuss the persistence of IPC objects. How does the persistence of a Pipe differ from that of a Shared Memory segment?

19

Describe the limitations of Pipes as an IPC mechanism.

20

What are the command-line utilities used to list and remove IPC facilities (specifically Shared Memory) in Linux? Give examples.