OS PyramidTechnion 234123 · Operating Systemsbasics → exam
the pyramid
Stage 3 / 10 · Foundations

IPCsupporting

Inter-Process Communication (IPC) is fundamental for understanding how independent processes and threads cooperate and share data. Mastering various IPC mechanisms like pipes, shared memory, and message queues, along with synchronization primitives, is crucial for designing robust concurrent systems. Exams often test your ability to select appropriate IPC methods and identify potential issues like race conditions or deadlocks in multi-process scenarios.

Where to learn it

lectureLecture 3
51 slides
Start with slides 1, 2, 3, 4, 5
tutorialTutorial 3 · ipc
67 slides

How to study it

  • Thoroughly understand the differences, advantages, and disadvantages of various IPC mechanisms (e.g., pipes vs. shared memory vs. message queues).
  • Practice implementing simple communication patterns using `ipc_pipes` and ensure a solid grasp of `pthread_lifecycle` for thread-based synchronization.
  • Review the specific examples and problem scenarios presented in `slide_tutorial_r3-ipc_s058`, `s059`, `s064`, and `s066` to understand common pitfalls and solutions.

What the exam asks

Exam questions typically involve analyzing a given multi-process/multi-threaded scenario, identifying the most suitable IPC mechanism, or debugging synchronization issues.

The components, basic → advanced

These are the atomic skills this stage is built from. Learn them in this order — later ones assume the earlier ones.

L3 · applied
pthread create/cancel/join lifecycle
needs first: process states
L3 · applied
Pipe IPC semantics
needs first: fork exec semantics

Exam subsections in this stage (12 parts across 4 questions)

2019B_Spring_AQ1core7 parts here

טבלת הקבצים וסנכרון

  1. 1· mcq· 3 pts

    אילו מנגנונים/אובייקטים יכולים לשמש לתקשורת בין תהליכים (IPC)? א. סיגנלים (signals) ופסיקות (interrupts) ב. FIFOS ופסיקות (interrupts) ג. סיגנלים (signals) ומשתנים גלובליים (global variables) ד. Pipes וזיכרון משותף (shared memory) ה. זיכרון משותף (shared memory) ומשתנים גלובליים (global variables) ו. Pipes ומשתנים גלובליים (global variables)

    libc syscall wrapper caching pitfallsLocal vs global interrupt disableSignal delivery and handler timingPipe IPC semanticsSRT / preemptive Gantt construction
  2. 4· mcq· 2 pts

    בחרו שורת קוד עבור שורה 6: א. write(my_pipe[1], “m”, 1); ב. read(my_pipe[0], buff, 1); ג. while(read(my_pipe[0], buff, 1)); ד. while(write(my_pipe[1], “m”, 1)); ה. buff[0] = 'm'; ו. שורה ריקה

    Pipe IPC semantics
  3. 5· mcq· 2 pts

    בחרו שורת קוד עבור שורה 9: א. write(my_pipe[1], “m”, 1); ב. read(my_pipe[0], buff, 1); ג. while(read(my_pipe[0], buff, 1)); ד. while(write(my_pipe[1], “m”, 1)); ה. buff[0] = ''; ו. שורה ריקה

    Pipe IPC semantics
  4. 6· mcq· 2 pts

    בחרו שורת קוד עבור שורה 12: א. write(my_pipe[1], “m”, 1); ב. read(my_pipe[0], buff, 1); ג. while(read(my_pipe[0], buff, 1)); ד. while(write(my_pipe[1], “m”, 1)); ה. buff[0] = 'm'; ו. שורה ריקה

    Pipe IPC semantics
  5. 7· mcq· 2 pts

    בחרו שורת קוד עבור שורה 7: א. read(my_pipe[0], buff, 1); ב. while(c--) read(my_pipe[0], buff, 1); ג. read(my_pipe[0], buff, --c); ד. write(my_pipe[1], “m”, 1); ה. while(c--) write(my_pipe[1], “m”, 1); ו. שורה ריקה

    Pipe IPC semantics
  6. 8· mcq· 2 pts

    בחרו שורת קוד עבור שורה 10: א. read(my_pipe[0], buff, 1); ב. while(c--) read(my_pipe[0], buff, 1); ג. read(my_pipe[0], buff, --c); ד. write(my_pipe[1], “m”, 1); ה. while(c--) write(my_pipe[1], “m”, 1); ו. שורה ריקה

    Pipe IPC semantics
  7. 9· mcq· 2 pts

    בחרו שורת קוד עבור שורה 13: א. read(my_pipe[0], buff, 1); ב. while(c--) read(my_pipe[0], buff, 1); ג. read(my_pipe[0], buff, --c); ד. write(my_pipe[1], “m”, 1); ה. while(c--) write(my_pipe[1], “m”, 1); ו. שורה ריקה

    Pipe IPC semantics