Question
Operating System Concept : The following code segment is the part of the program. What are the succeeding 3 program counter, in term of line
Operating System Concept :
The following code segment is the part of the program.
What are the succeeding 3 program counter, in term of line number in this program, after the program executes the instructions on Line X?
When the system call is interrupted by a signal, will the system call be resumed after the signal is caught? If yes, please illustrate the procedure to resume. Otherwise, please describe how the operating system terminates the system call.
The A and B part in the above code segment can be separated into multiple processes or multiple threads. Please describe how the measured flow in A part can be sent to B part when multiple process and multiple thread are used.
#include
int main(int argc, char **argv){ void catch(int); int a; printf("Hello Taipei!! "); signal(SIGSEGV, catch); /* A part : measure the traffic flow */ a = *(int *) 0; // LINE X /* B part : change the traffic light */ }
void catch(int snum){ printf("Oooops, there is an illegal memory access(%d). ", snum); raise(SIGSTOP); exit(0); }
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started