Question: A global data structure and some hardware registers are being accessed for read and write operations inside an interrupt service routine. The same global data
A global data structure and some hardware registers are being accessed for read and write operations inside an interrupt service routine. The same global data structure and hardware registers may also be accessed by a single protocol task. Select all that applies for each of the following questions.
4. A software engineer concerned about a potential data corruption, uses mutual exclusion semaphores (mutex) to protect the shared resources inside both protocol task and the interrupt service routine. Do you agree with his design choice? A) Yes, it is safe to use a mutual exclusive semaphore since we only have a single task accessing the shared resources. B) No, because use of mutex is not needed since there is no chance of data corruption C) No. Use of mutex inside ISR is a bad idea since may result in a deadlock. D) Yes, since both ISR and protocol task have read/write access to these resources, they must be protected by means of mutual exclusive semaphore
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
