Question: Please solve part b In a co-operative multitasking operating system, the operating systems gives the appearance of running multiple processes at the same time by

 Please solve part b In a co-operative multitasking operating system, the

Please solve part b

In a co-operative multitasking operating system, the operating systems gives the appearance of running multiple processes at the same time by switching which process is currently running on the CPU. Internally, the OS models the lifetime of a processes as moving between a series of states: Running, Blocked, and Runnable. (a) An extract from a C program is shown below, suppose that this code was exe- cuted on co-operative multitasking operating system. Which lines of the pro- gram would cause the operating system to move the process from the Running state to the Blocked state? #include #include #include #define PRIME LIMIT (1000000) int main(int arge, char **argv) int a,b; int prime (PRIME_LIMIT): char out (PRIME LIMIT); char *p*q*r; int offt int i, j,n, ip; if (argo 1000000 Il a > b) { fprintf(stderr, "Invalid arguments); exit(2); ) printf("Searching for prime numbers between 8d and do, a, b); (b) Another extract from the same C program is shown below. However, a co- operative multitasking operating system would not be able to move the pro- cess from the Running to the blocked state while this code was executing. Give a brief explanation of why a co-operative multitasking operating system would not be able to move the process between the two states and why a pre- emptive mutltiasking operating system would be able to. for (i = 3; i 0) ( if (i > a) break; ) for(j = i+1; j 2

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!