CSC264 ยท 2078 ยท 5 marks
Write short notes on: a. IPC in Linux b. Disk access
Write short notes on: a. IPC in Linux b. Disk access [5]
Quick answer
Inter-Process Communication (IPC) refers to the mechanisms that allow processes running in Linux to communicate and synchronize with each other.
Short Notes: IPC in Linux and Disk Access
a. IPC in Linux (Inter-Process Communication)
In Linux, processes are independent units of execution. However, many applications require processes to share data or coordinate their activities. Linux provides several IPC mechanisms:
Key IPC Mechanisms in Linux:
| Mechanism | Description |
|---|---|
| Pipes | Allow one-way communication between related processes (parent-child). Data flows in a single direction. |
| Named Pipes (FIFOs) | Similar to pipes but allow communication between unrelated processes using a file name in the filesystem. |
| Signals | Used to notify a process that a particular event has occurred (e.g., SIGKILL, SIGTERM). |
| Message Queues | Allow processes to send and receive messages in a queue format, managed by the kernel. |
| Shared Memory | Allows multiple processes to access the same region of memory, providing the fastest form of IPC. |
| Semaphores | Used for synchronization between processes to avoid race conditions when accessing shared resources. |
| Sockets | Allow communication between processes on the same machine or across a network. |
Key Points:
- Linux processes run in foreground or background mode
- The Linux kernel mediates and controls access to system resources including IPC facilities
- IPC mechanisms are managed through kernel modules stored in
/lib/modulessubdirectories - Proper synchronization is essential to prevent data corruption when multiple processes share resources
b. Disk Access
Disk access refers to the process of reading from or writing data to a hard disk drive. Understanding disk access is important for optimizing I/O performance.
Disk Structure (from notes):
A disk is divided into:
- Tracks: Concentric circles on each platter surface
- Cylinders: The same track across all platters
- Sectors: Subdivisions of each track
Each platter has 2 surfaces with read/write heads for each surface.
Disk Access Time Formula:
Disk Access Time = Seek Time + Rotational Latency + Transfer Time
Components Explained:
| Component | Definition |
|---|---|
| Seek Time | Time taken to move the disk arm to the specified track where the read/write request will be satisfied |
| Rotational Latency | Time taken for the desired sector to rotate into position under the read/write head |
| Transfer Time | Time to actually transfer the data; depends on rotating speed and number of bytes to be transferred |
Additional Terms:
- Random Access Time = Seek Time + Rotational Latency
- Disk Response Time: Average time spent by a request waiting to perform its I/O operation
- Transmission Time: Total time taken to access the whole record
- Transfer Rate: Rate at which data moves from disk to the computer
Example:
If Seek Time = 5 ms, Rotational Latency = 3 ms, Transfer Time = 2 ms:
Disk Access Time = 5 + 3 + 2 = 10 ms
Optimization:
- RAID (Redundant Array of Independent Disks) improves disk performance by striping data across multiple disks, allowing overlapping I/O operations
- Virtual Memory uses disk as an extension of RAM (swap space), though disk access is slower than RAM access
Both topics are core components of Operating System I/O and process management as covered in the Linux OS architecture.
Short on time? The 1, 5 and 10 mark versions of this answer, flashcards and practice sets come with a program pass.