OS Mid-1
OS Mid-1
Total
20 10 10 15 55
Marks
Marks
Obtained
#include <sys/types.h>
#include<iostream>
#include<unistd.h>
using namespace std;
#define SIZE=5
int main() {
int i;
pid_t pid;
pid = fork();
if (pid == 0)
nums[i]*=-i;
wait(NULL);
return 0;
fork();
How many times “Hello World” will be printed on the screen? Also draw the Process Tree of the given
program.
(b) Can two running processes share the complete process image in physical memory (not just parts of
it)?
Each process is assigned a numerical priority, with a higher number indicating a higher relative priority. In
addition to the processes listed below, the system also has an idle task (which consumes no CPU resources
and is identified as Pidle). This task has priority 0 and is scheduled whenever the system has no other
available processes to run. The length of a time quantum is 20 units. If a process is preempted by a higher
priority process, the preempted process is placed at the end of the queue.