Suppose in a multiprogramming environment, the following C program segment is executed. A process goes into I/O queue whenever an I/O related operation is performed. Assume that there will always be a context switch whenever a process requests for an I/O, and also whenever the process returns from an I/O. The number of times the process will enter the ready queue during its lifetime (not counting the time the process enters the ready queue when it is run initially) is _________ . (Answer in integer)
int main( )
{
int x = 0,i=0;
scanf("%d", &x);
for(i=0; i<20;i++)
{
x=x+20;
printf("%d\n", x);
}
return 0;
}
Consider a process P running on a CPU. Which one or more of the following events will always trigger a context switch by the OS that results in process P moving to a non-running state (e.g., ready, blocked)?
Which of the following process state transitions is/are NOT possible?
Which one or more of the following need to be saved on a context switch from one thread (T1) of a process to another thread (T2) of the same process?