Answer:
Check the explanation
Step-by-step explanation:
a)
It is a technical impossible for the update in the value of sensor1 in ISR while the main function is still evaluating whether sensor1 is with a fault or not at the point of execution in the critical section block because in this block no other instructions are not executed until the completion of instructions in the critical section.
Also semaphores are used to execute instructions when they are get lock to execute. if we write the code in operating system in such a way that at any instant of time shared resources cannot be executed in parallel, then only it is not possible to update ISR value of sensor1 while main function checking for sensor1 faultiness.
-> It is possible that to update ISR value of sensor1 while main function checking for sensor1 faultiness if operating system and compilers are coded for parallel execution even though shared resources.
for example:
int i=5;
main()
if (i==5)
{print "i is %d",i}
other()
i=7;
//if above program executes parallel boh main() and other() functions are parallel executed
then at first clock cycle in main method i=5 so goes to next instruction print.
but in the first clock cycle also in other method i value changes to 7.
so in the next clock cycle in main method result as " i is 7.
b)
if there is an occurrence of error related to only for faulty value of sensor 1 or sensor 2 then only it is possible for this code would report "Sensor1 faulty" or "Sensor2 faulty" when there is no error related to other issues.
Like power interrupt etc.
if a spurious error can cause not only sensor1 or sensor2 to be a faulty value but also interrupting whole program or suspending entire program etc may possible for this code would not report "Sensor1 faulty" or "Sensor2 faulty".
c)
if we Assume the interrupt source for ISR() is timer-driven , then there are conditions could cause this code to never check whether sensors are faulty or not.
timer driven means set a clock for its execution how can we set the clock. if we set clock for ISR() method to stop the entire program or repeated continuously at setting up interrupts and enabling interrupts.
these two conditions 1)set clock to stop the program would not enter into checking sensors faultiness.
2)set the clock to spare entire time to execute at setting up interrupts and enabling interrupts. repeated continuously.
It means never run ":while(1) {} " block instructions for checking faultiness of the sensors.