The pseudo-codes below shows a typical Round Robin software architecture. If every device requires 20ms to service and UpdateLCD() requires 10ms to execute, what is the worst case response time?
void main (void) {
while(1) {
if (!! Device A needs Service) {
!! Handle Device A
}
if (!! Device B needs Service) {
!! Handle Device B
}
. . . .
if (!! Device D needs Service) {
!! Handle Device D
}
UpdateLCD();
}
}
Since there are a total of 4 devices (A,B,C,D) and if immediately after servicing Device A, Device A needs servicing, the worst case response time here should be 20+20+20+10 = 70ms (assuming Devices B, C and D also needs servicing).
However, in the answer selection, there is only: 85ms, 110ms, 35ms and 25ms. I think i need help on my understanding of the round robin architecture.. Thanks!