csc number 3 last four digits of IDs c, d c, d E. c, d, e (12) For each of the f
ID: 3598974 • Letter: C
Question
csc
number 3
last four digits of IDs c, d c, d E. c, d, e (12) For each of the following statements indicate whether it is true or false justification (3 points for each) A process is a program or, A (le(ecs .^vose( c( a. b. CPU scheduler is a long-term scheduler which selects which proce into the ready queue. Traf, fl :3 fl, r ,r ‘f Time-Sharing system executes programs that are guaranteed O la tasks that they carry out. c. d. Round-robin scheduling never results in more context switches that 3. (20) Explain what will be output for the following program? #include #include # include int value = 5; int mainO pid_t pid; pid-forkO: if(pid 0) printf("I am the child process. In"); value+=15; else if (pid> 0) wait (NULL); printf("I am the parent process, value=%d ", value); exit(0); 4. (23) Consider the following set of processes, with the lengt milliseconds Priority Process Burst Times P1 P2 P3 P4 P5 10 4 The processes are assumed to have arrived in the order P1, P2Explanation / Answer
Fork system call creates a new child process, which runs simultaneously with parent process (the one which called system call fork) . After this both processes will execute the next instruction following the fork() system call.
Output:
I am the child process
I am the parent process, value = 5.
Note:
here the child process changed the value but it is not reflected in its parent process.
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.