Computer Systems: A Programmer's Perspective (3rd Edition)
3rd Edition
ISBN: 9780134092669
Author: Bryant, Randal E. Bryant, David R. O'Hallaron, David R., Randal E.; O'Hallaron, Bryant/O'hallaron
Publisher: PEARSON
expand_more
expand_more
format_list_bulleted
Question
Chapter 8.2, Problem 8.1PP
Program Plan Intro
Given:
Process | Start time | End Time |
A | 0 | 2 |
B | 1 | 4 |
C | 3 | 5 |
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
Assignment requires that you should create a virtual machine in AWS (Amazon Web Services) to develop your programs to examine the performance of different pthread contention scope. Try to adopt two different pthread contention scope, process-contention scope, and system-contention scope, execute and compute the average turnaround time.
Problem Statement
According to the code attached in the document, rewrite the function runner that
l The value of MAX is the last 8 number of your student ID
l Display the turnaround time of each pthread of each scheduling algorithm
l Please discuss the results of these scheduling algorithms.
Code MUST BE WRITTEN IN C/C++
#include <pthread.h>
#include <stdio.h>
#include <sys/time.h>
#define NUM_THREADS 5
struct timeval tp_s, tp_e;
struct timezone tzp_s, tzp_e;
void *runner(void *param)
{
int i=0,j=0;
long x;
pthread_t tid= pthread_self();
struct timeval tp_s1, tp_e1;
struct timezone tzp_s1, tzp_e1;
printf(" %d…
26. A system has four processes and five allocatable resources. The current allocation and
maximum needs are as follows:
Available
00 x 1 1
Allocated
Махітит
Process A
10 211
11213
Process B
20110
22210
Process C
Process D
11010
21310
1111 0
11221
What is the smallest value of x for which this is a safe state?
Urgent
Chapter 8 Solutions
Computer Systems: A Programmer's Perspective (3rd Edition)
Ch. 8.2 - Prob. 8.1PPCh. 8.4 - Prob. 8.2PPCh. 8.4 - Prob. 8.3PPCh. 8.4 - Prob. 8.4PPCh. 8.4 - Practice Problem 8.5 (solution page 797) Write a...Ch. 8.4 - Practice Problem 8.6 (solution page 797) Write a...Ch. 8.5 - Practice Problem 8.7 (solution page 798) Write a...Ch. 8.5 - Prob. 8.8PPCh. 8 - Prob. 8.9HWCh. 8 - In this chapter, we have introduced some functions...
Ch. 8 - How many hello output lines does this program...Ch. 8 - How many "hello' output lines does this program...Ch. 8 - Prob. 8.13HWCh. 8 - How many hello output lines does this program...Ch. 8 - How many "hello lines does this program print?Ch. 8 - Prob. 8.16HWCh. 8 - Prob. 8.17HWCh. 8 - Consider the following program: Determine which of...Ch. 8 - How many lines of output does the following...Ch. 8 - Use execve to write a program called my1s whose...Ch. 8 - What are the possible output sequences from the...Ch. 8 - Write your own version of the Unix system function...Ch. 8 - One of your colleagues is thinking of using...Ch. 8 - Modify the program in Figure 8.18 so that the...Ch. 8 - Write a version of the fgets function, called...
Knowledge Booster
Similar questions
- Computer Sciencearrow_forward####### in python ########## Calculate the approximate solution of the system of equations. xy = (z^2)+1 xyz + y^2=(x^2)+2 (e^x)+z=(e^y)+3 Stop conditions - a norm of the function value (||x|| infinty) less than - 1.10^-6 The code will print to the screen the solution in each iteration and the norm of the function values.arrow_forwardPlease refer to this textbook: “A. Silberschatz, P. B. Galvin and G. Gagne, “Operating System Principles,”7th Edition, John Wiley & Sons Inc., 2006.” And answer the following questions: Question:The Ricart& Argwala mutual exclusion algorithm: (a) Does not depend on time stamps in messages while Lamport's does. (b) Cannot handle the case where two or more processes request the same resource at the same time. (c) Does not require a process to send messages to the entire group while Lamport's does. (d) Requires fewer messages than Lamport's algorithm.arrow_forward
- In the context of operating systemsarrow_forwardIn the context of operating systemsarrow_forward73. Deadlock prevention is a set of methods : a. to ensure that at least one of the necessary conditions cannot hold b. to ensure that all of the necessary conditions do not hold c. to decide if the requested resources for a process have to be given or not d. to recover from a deadlockarrow_forward
- Course:Operating System Solution 4(b) neededarrow_forwardj f₁(j) f₂(j) 2. for the following instance of the Assembly-Line Scheduling problem, complete the following table constructed by the Dynamic Programming (DP) algorithm. The station time and the transfer times are indicated in the diagram below. Station 2 Station S11 3 4 1 2 2 S21 $12 S22 2 S13 3 2 2 3 S23 $14 4 4 S24 3 $15 2 5 S25 6 $16 3 S26 3 2arrow_forwardProblem 4 There are two approaches for scheduling tasks on multiprocessor platform: the partitioned approach and the global approach. The table below shows Ci (WCET) and Ti (period) for six periodic tasks to be scheduled on m = 3 processors. The relative deadline of each periodic task is equal to its period. T T1 10 T2 10 25 T3 12 30 T4 10 T5 8. 20 T6 7 100 The task set is schedulable using rate-monotonic partitioned scheduling algorithm. Show how the task set is partitioned on m = 3 processors so that all the deadlines are met?arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- C++ for Engineers and ScientistsComputer ScienceISBN:9781133187844Author:Bronson, Gary J.Publisher:Course Technology Ptr
C++ for Engineers and Scientists
Computer Science
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Course Technology Ptr