Hewlett-Packard

  www.hp.com
  www.hp.com
Work in HR? Unlock Free Profile

Interview Question

Firmware Engineer Interview Houston, TX

If you have two devices that can interrupt your program and

  you want to give priority and atomicity to one of the processes over the other, but you cannot use a semaphore or mutex, how would you do it?
Answer

Interview Answer

3 Answers

0

Use an interrupt mask.

Interview Candidate on May 24, 2012
0

How would an interrupt mask help? What if the threads are dependent on each other? What if they use the same resource?

Viewer on Dec 10, 2012
1

The answer is that the process who needs to be atomic and is more-important will disable interrupts. The remaining process is therefore prevented from operation until the primary process completes its task, then it re-enables interrupts just after the atomic section.

OP on Dec 12, 2012

Add Answers or Comments

To comment on this question, Sign In with Facebook or Sign Up