Question 1: In class we discussed how the following code
int main(void) {
for (int i = 0; i < N; ++i) {
long start = get_time();
long end = get_time();
times[i] = end − start;
}
}
will mostly put small times in times
(a few nanoseconds), but there will be a few much larger values too (a few milliseconds). These longer times are generally caused a
Question 2: (see above) Each of the following is either synchronous or asynchronous. Which are synchronous?
Select all that apply
Question 3: (see above) Software exceptions are most similar to which kind of hardware exception?
Question 4: (see above) Which of the following are true about signal handlers?
Select all that apply
Question 5: (see above) Which of the following are true about exception handlers?
Select all that apply
Question 6: If process A is running, then the operating system context switches to process B. After the switch, where is the context of process A stored?
Question 7: Suppose process A is running when the operating system context switches to process B. After the switch, where is the context of process B stored?
Question 8: Given a call to setjmp
like:
if (setjmp(env) == 0) {
...
} else {
...
}
Which of the following are saved in env
?
Select all that apply
Question 9: If an external event that would trigger an interrupt happens, but interrupts are disabled, then