Three distinct types of events that allows OS to get back CPU from the current user process is (1) system calls, (2) har
Posted: Mon May 09, 2022 6:02 am
Three distinct types of events that allows OS to get back CPU
from the current user process is (1) system calls, (2) hardware
interrupts, and (3) CPU traps (such as segmentation faults). Which
of these events may occur upon executing each line of the following
code? Mark appropriate blanks with X. For example, when main( ) is
called, this program gets started with the execlp system call. When
main( ) returns 0, the exit system call is invoked implicitly.
Don’t fill out any shaded blanks. Note that some statements may not
cause any events or the others may cause multiple events.
System calls Interrupts Traps X #include <iostream> // cout using namespace std; void func( int numberi, int number2 ) { cout << number1 + number2 << endl; } int main( void ) { int *array = new int[100]; cin >> array[O]; // 321 is typed from the keyboard. *(array + 99) 123; func( array[O], array[99] ); *(array 10000) = 456; return 0; } = X
from the current user process is (1) system calls, (2) hardware
interrupts, and (3) CPU traps (such as segmentation faults). Which
of these events may occur upon executing each line of the following
code? Mark appropriate blanks with X. For example, when main( ) is
called, this program gets started with the execlp system call. When
main( ) returns 0, the exit system call is invoked implicitly.
Don’t fill out any shaded blanks. Note that some statements may not
cause any events or the others may cause multiple events.
System calls Interrupts Traps X #include <iostream> // cout using namespace std; void func( int numberi, int number2 ) { cout << number1 + number2 << endl; } int main( void ) { int *array = new int[100]; cin >> array[O]; // 321 is typed from the keyboard. *(array + 99) 123; func( array[O], array[99] ); *(array 10000) = 456; return 0; } = X