Question: 3. Consider the following code snippet in Figure 1: include #include catdio.h> include #include #include int main(int arge, char *argvil) printf(I am: %d ,
3. Consider the following code snippet in Figure 1: include #include catdio.h> include #include #include int main(int arge, char *argvil) printf("I am: %d ", (int) getpid()); pid_t pid = fork (); printf ("fork returned: %d ", (int) pid); if (pid < 0) { 1 if 1 perror ("Fork failed"); (pid = 0) [ printf ("Hello from the other side (number: @d) ", (int) getpid ()); printf ("Child process is exiting "); exit (0) ; printf("I am the parent waiting for the child process to end "); wait (NULL); printf ("parent ess is exiting "); return(0); Figure 1: Code Snippet for Question 3.(a) Determine the output of the program in Figure 1. What are CPU bound and I/O bound processes? "Mixing these two types of process is necessary" -justify the statement. What type of scheduler ensures a good mix of processes? Explain its working mechanism with diagram. (COI) (POI) 2+4 +6 (COI) (POI)
Step by Step Solution
There are 3 Steps involved in it
It seems like your code snippet is incomplete and contains syntax errors Ill pr... View full answer
Get step-by-step solutions from verified subject matter experts
