TomoLink
TCS NQT GuideTCS NQT Programming Logic & CS FundamentalsOperating System Fundamentals (Threading, Deadlock, Semaphore)

Operating System Fundamentals (Threading, Deadlock, Semaphore)

Learn core concepts, essential formulas, and attempt practice questions designed on the latest TCS NQT testing patterns.

Key Concepts & Formulas

  • 1Process: Program in execution. Thread: Light-weight unit of process.
  • 2Deadlock: Four conditions (Mutual exclusion, Hold & Wait, No preemption, Circular wait).
  • 3Semaphore: Integer variable used for process synchronization.

TCS NQT Style Practice Questions

Practice Question 1

Which of the following is NOT a condition for deadlock?

A) Preemption
B) Mutual Exclusion
C) Hold and Wait
D) Circular Wait

Correct Answer: A) Preemption

Step-by-step Solution: The condition is NO preemption. If resources can be preempted, deadlock won't occur.

Practice Question 2

A semaphore initialized to 1 is called a:

A) Binary Semaphore
B) Counting Semaphore
C) Mutex
D) Signal

Correct Answer: A) Binary Semaphore

Step-by-step Solution: Semaphores restricted to 0 and 1 are binary semaphores (often used like locks).

Study Pro-Tip

Memorize the four Coffman conditions for deadlocks. They appear in almost all OS papers.