Qualcomm Interview Question
Software Engineer / DevelopersA real time example, There are three people sitting in front of white board, a pen placed with that white board. Now one person start writing on the board others has to wait until he finished, once he finished writing then he will replace that pen, now next person will get chance to start write on that board. similarly for other one. her only one pen is available so other can't start until he replace that pen.
One should never sleep in an Interrupt handler. Things that might cause blocking/sleeping are:
1. Using semaphore to lock a shared data structure
2. Calling functions that might sleep
3. Allocating memory
Also one should not perform time consuming tasks in an ISR.
ISR's should not invoke functions which may cause ``blocking'' of the caller. An ISR must not perform I/O, A call to a device driver may block the system if the caller needs to wait for the device.
- Anonymous October 16, 2008