Busy Waiting
Q.1. Does busy waiting leads to deadlock?
Answer:
Busy waiting does not lead to deadlocks but incorrect implementation of the synchronization mechanisms and improper use such as spin locks can lead towards deadlock.
Q.2. Name the techniques that can be used as an alternatives for waiting?
Answer:
Techniques such as sleep or blocking are used as an alternative for waiting where the process relinquishes the CPU and is only scheduled to run when the condition for which it is waiting becomes true.
Q.3. Is it efficient to Use busy waiting in distributed system?
Answer:
No, it is actually problematic to use busy waiting in distributed systems because of the variabilities in network conditions and communication delays. In distributed systems methods such as distributed locking and message passing are majorly being used.
Q.4. What is the difference between busy waiting and blocking?
Answer:
In busy waiting the process continuously checks for a condition and consumes the CPU cycle continuously whereas in blocking a process does not use CPU by remaining inactive until it gets the desired condition.
Q.5. Does the process of busy waiting affects the system responsiveness?
Answer:
Continuous process of busy waiting can easily degrade the responsiveness of the system as it utilizes the CPU and even causes the delay for handling the interactions of the user.
Busy Waiting in OS
Waiting in the operating system consists of two approaches namely Busy Waiting and Sleep Waiting. Busy waiting is defined as the process where the process or task continuously the processor and waits for the condition to be satisfied. Whereas Sleep waiting is defined as a process where the task or process does not consume the processor when it is waiting for its condition to be satisfied. The below article covers in detail busy waiting.