CS Atlas GATE 2027
Operating Systems course
0 / 58 complete

Operating Systems/Phase 1 · Processes & Threads

Chapter review LI-1.2 · Item 11 of 58

Chapter 1.2 Lock-in

Read at your own pace. Try the questions before opening the answers.

On this page

Phase 1Ch 1.2 Threads and IPC

ACompressed recap

Threads share code, globals, heap, files; private stack, registers, PC. User-level threads: fast, all block together; kernel-level: independent, parallel. Models many-to-one, one-to-one, many-to-many. IPC: shared memory (fast, needs sync), message passing (kernel copies, blocking or not), pipes (one-way; named for unrelated processes); producer–consumer waits on full/empty.

BMerged rule card

1.2.1 Threads: what they share, user-level vs kernel-level threads

  • Thread = path of execution inside a process; shares code, data, heap, open files; private stack, registers, PC, thread ID.
  • Threads are cheaper to create and switch than processes.
  • User-level: fast, kernel unaware, one block blocks all, no parallelism. Kernel-level: kernel-scheduled, independent blocking, parallel on multiple cores.
  • Models: many-to-one, one-to-one, many-to-many.

1.2.2 Inter-process communication: shared memory, message passing and pipes

  • Shared memory: map a common region; fast; programmer synchronizes.
  • Message passing: send/receive via the kernel; direct or indirect (mailbox); blocking or non-blocking; works across machines; copies data.
  • Ordinary pipe: one-way, parent–child; named pipe (FIFO) for unrelated processes; two-way needs two pipes.
  • Producer waits when the buffer is full; consumer waits when empty.

CInterleaved GATE-style questions

Q1 · MCQ · 1 mark(s) — Threads

A process has 4 threads. How many stacks does it have?

  1. (A) 1
  2. (B) 2
  3. (C) 8
  4. (D) 4

Q2 · MSQ · 2 mark(s) — Kernel threads

Which are advantages of kernel-level threads over user-level threads?

  1. (A) The kernel can schedule each thread separately.
  2. (B) Thread switches never involve the kernel.
  3. (C) A blocking call blocks only that thread.
  4. (D) Threads can run in parallel on multiple CPUs.

Q3 · MCQ · 1 mark(s) — Sharing

Which of these is NOT shared between threads of the same process?

  1. (A) Register values
  2. (B) Heap memory
  3. (C) Code
  4. (D) Global variables

Q4 · MCQ · 1 mark(s) — Model

In the many-to-one model, the main drawback is:

  1. (A) threads cannot share memory
  2. (B) too many kernel threads
  3. (C) a blocking system call blocks all threads
  4. (D) threads cannot be created

Q5 · MCQ · 1 mark(s) — IPC

Which IPC mechanism requires the processes themselves to handle synchronization?

  1. (A) Blocking pipes
  2. (B) Mailboxes
  3. (C) Message passing
  4. (D) Shared memory

Q6 · NAT · 1 mark(s) — Pipes

Minimum number of ordinary pipes for full two-way communication between 2 processes?

Numerical answer: ________

Q7 · MCQ · 1 mark(s) — Named pipes

Two unrelated processes (not parent and child) want to use a pipe. They should use a:

  1. (A) shared stack
  2. (B) ordinary pipe
  3. (C) named pipe (FIFO)
  4. (D) thread

Q8 · MCQ · 1 mark(s) — Blocking

A consumer reads from an empty ordinary pipe. It:

  1. (A) blocks until data is written
  2. (B) terminates the producer
  3. (C) reads 0 bytes and crashes
  4. (D) reads old data

DAnswer Vault

Try the questions first. Open when you are ready to check.

🔐 Open the Answer Vault

Q1 Answer: (D) · 1 mark(s)

One per thread.

  • (A) is wrong: Stacks are private.
  • (B) is wrong: No.
  • (C) is wrong: No.

Re-read: Lesson 1.2.1 — Threads: what they share, user-level vs kernel-level threads

Q2 Answer: (A) (C) (D) · 2 mark(s)

Kernel threads do need the kernel to switch.

  • (B) is wrong: That is the user-level advantage.

Re-read: Lesson 1.2.1 — Threads: what they share, user-level vs kernel-level threads

Q3 Answer: (A) · 1 mark(s)

Each thread has its own registers.

  • (B) is wrong: Shared.
  • (C) is wrong: Shared.
  • (D) is wrong: Shared.

Re-read: Lesson 1.2.1 — Threads: what they share, user-level vs kernel-level threads

Q4 Answer: (C) · 1 mark(s)

Only one kernel thread underneath.

  • (A) is wrong: They share memory.
  • (B) is wrong: There is only one.
  • (D) is wrong: They can be created.

Re-read: Lesson 1.2.1 — Threads: what they share, user-level vs kernel-level threads

Q5 Answer: (D) · 1 mark(s)

Plain memory reads and writes.

  • (A) is wrong: Blocking provides order.
  • (B) is wrong: Kernel-managed.
  • (C) is wrong: Built-in ordering.

Re-read: Lesson 1.2.2 — Inter-process communication: shared memory, message passing and pipes

Q6 Answer: 2 · 1 mark(s)

One per direction.

Re-read: Lesson 1.2.2 — Inter-process communication: shared memory, message passing and pipes

Q7 Answer: (C) · 1 mark(s)

It has a name in the file system.

  • (A) is wrong: Not a mechanism.
  • (B) is wrong: Needs a common ancestor.
  • (D) is wrong: Unrelated.

Re-read: Lesson 1.2.2 — Inter-process communication: shared memory, message passing and pipes

Q8 Answer: (A) · 1 mark(s)

Read on an empty pipe waits.

  • (B) is wrong: No.
  • (C) is wrong: It waits.
  • (D) is wrong: No old data exists.

Re-read: Lesson 1.2.2 — Inter-process communication: shared memory, message passing and pipes

Ready for the next idea?

Mark this item complete when you’ve finished reading and working through it.