TCS Papers: Sample Questions 436 - 437 of 502

Examrace Placement Series prepares you for the toughest placement exams to top companies.

Question number: 436

» Basic CS » Operating System

Short Answer Question▾

Write in Short

What is busy waiting?

Explanation

  • The repeated execution of a loop of code while waiting for an event to occur is called busy-waiting.

  • The CPU is not engaged in any real productive activity during this period, and the process does not progress toward completion.

  • A process that wants to enter a critical section, checks first to see if the entry is allowed and if it is not the process waits in a tight loop.

  • Continuously testing a variable waiting for some value to appear is denoted as

Image of The busy waiting

Image of the Busy Waiting

Given the image is define the busy waiting

Question number: 437

» Basic CS » Operating System

Essay Question▾

Describe in Detail

What is an idle thread?

Explanation

  • In Windows NT operating systems, the System Idle Process contains one or more kernel threads which run when no other runnable thread can be scheduled on a CPU.

  • For example, there may be no runnable thread in the system, or all Runnable threads are already running on a different CPU.

  • In a multiprocessor system, there is one idle thread associated with each CPU.

  • The primary purpose of the idle process and its threads is to eliminate what would otherwise be a special case in the scheduler.

  • Without the idle threads, there could be cases when no threads were runnable, or “Ready” in terms of Windows scheduling states. Since the idle threads are always in a Ready state (if not already Running), this can never happen.

  • Thus whenever the scheduler is called due to the current thread leaving the CPU, it can always find another thread to run on that CPU, even if it is only the CPU’s idle thread.

Image of Idle Thread

Image of Idle Thread

Given the image is define the idle thread execution