Waiting for answer This question has not been answered yet. You can hire a professional tutor to get the answer.
QUESTION
Question 1:Which of the following components of program state are shared across threads in a multithreaded process?
Question 1:Which of the following components of program state are shared across threads in a multithreaded process? and explaina.Register valuesb.Heap memoryc.Global Variablesd.Stack memoryQuestion 2. Can a multithreaded solution using multiple user-level threads achieve better performance on a multiprocessor system than on a single-processor system? explainQuestion 3. The program shown in figure 4.11 uses the Pthreads API.What will be the output from the program at LINE C and LINE P ?#include <pthread.h>#include <stdio.h>int value = 0void *runner (void *param); /* the thread */int main(int argc, char *argv []){int pid;pthread_t tid;pthread_attr_t attr;pid = fork();if (pid == 0) { /*child process */pthread_attr_init(&attr);pthread_create(&tid,&attr,runner,NULL);pthread_join(tid,NULL);printf("CHILD: value =%d",value); /* LINE C */}else if (pid > 0) { /* parent process */ wait(NULL);printf("PARENT: value = %d",value); /* LINE P */}}void *runner (void *param) {value = 5pthread_exit(0);}Question 4.consider the following set of processes,with the length of the CPU burst given in milliseconds:PROCESS: P1,P2,P3,P4,P5BURST TIME:10, 1, 2, 1, 5PRIORITY: 3, 1, 3, 4, 2The processes are assumed to have arrived in the order P1,P2,P3,P4,P5,all at time 0.a. Draw four Gantt charts that illustrate the execution of these processes using the following scheduling algorithms:FCFS,SJF,Nonpreemptive pioroty (a smaller priority number implies a higher priority),and RR (quantum=1).b.What is the turnaround time of each process for each of the scheduling algoritms in part a?c. What is the waiting time of each process for each of the scheduling algoritms in part a?d. which of the algorithms in part a results in the minimum average wating time (over all processes)?Question 5. which of the following scheduling algorithms could result in starvation?explaina.Fist-come,First-servedb.shortest job firstc.Round robind.PriorityQuestion 6. Construct the schedule for the following set of jobs if multi-level feedback queue is used.Assume we use 3 levels in the multi-level feedback queue and that the time quantum for level 1 is 1 time units and the time quantum for level 2 is 1.5 time units.jobs : A B C D E F RESPECTIVELY Arrival Time: 0 1 2 3 4 5 RESPECTIVELYService Time: 4 2 5 3 4 5 RESPECTIVELYQuestion 7. Create a child process and create a history feature.using Unix operating system.
Show more