A2- Potokar, Charles
.docx
keyboard_arrow_up
School
Fairfield University *
*We aren’t endorsed by this school
Course
3313
Subject
Industrial Engineering
Date
Apr 3, 2024
Type
docx
Pages
5
Uploaded by mycomputer33333
IST 341/IST 606 Management of Business Networks
Assignment 2
Due Date: February 18, 2024, Midnight
Chapter 4:
1.
Five jobs arrive nearly simultaneously for processing and their estimated CPU cycles are,
respectively: Job A = 2 ms, Job B = 12 ms, Job C = 15 ms, Job D = 7 ms, and Job E = 3 ms.
a. Using FCFS, in what order would they be processed? What is the total time required to process all five jobs? What is the average turnaround time for each of these five jobs? b. Using SJN, and assuming that all jobs are present when the algorithm begins, in what order would they be processed? What is the total time required to process all five jobs? What is the average turnaround time for all five jobs? c. Using SJN, and assuming that all jobs are present when the algorithm begins, what is the average turnaround time for all five jobs using these speeds: Job A = 12 ms, Job B = 2 ms, Job C = 15 ms, Job D = 7 ms, and Job E = 3 ms. a) FCFS:
Job A: 2 ms → Job B: 12 ms → Job C: 15 ms → Job D: 7 ms → Job E: 3 ms
Time required = 2 + 12 + 15 + 7 + 3 = 39 ms
Turnaround time:
Job A = 2 ms
Job B = 2 + 12 = 14 ms
Job C = 2 + 12 + 15 = 29 ms
Job D = 2 + 12 + 15 + 7 = 36 ms
Job E = 2 + 12 + 15 + 7 + 3 = 39 ms
b) SJN:
When it comes to processing sequence, the shortest work is processed first.
Job A: 2 ms → Job E: 3 ms → Job D: 7 ms → Job B: 12 ms → Job C: 15 ms
Time required = 2 + 3 + 7 + 12 + 15 = 39 ms
Turnaround time:
Job A = 2 ms
Job E = 2 + 3 = 5 ms
Job D = 2 + 3 + 5 + 7 = 17 ms
Job B = 2 + 3 + 5 + 7 + 12 = 29 ms
Job C = 2 + 3 + 5 + 7 + 12 + 15 = 44 ms
c) SJN:
Job E: 3 ms → Job A: 12 ms → Job D: 7 ms → Job C: 15 ms
Time required: 39 ms
Turnaround time:
Job E = 3 ms
Job A = 3 + 12 = 15 ms
Job D = 3 + 12 + 7 = 22 ms
Job C = 3 + 12 + 7 + 15 = 37 ms
2.
Given the following information:
Job
Arrival Time
CPU Cycle
A
0
15
B
2
2
C
3
14
D
6
10
E
10
2
Calculate which jobs will have arrived ready for processing by the time the first job is finished or is first interrupted. Do your calculation using each of the following scheduling algorithms.
a.
FCFS: Remaining 4 processes
b.
SJN: Remaining 4 processes
c.
SRT: Only process B
d.
Round Robin: Processes B and C
3.
Using the same information from the previous exercise, calculate the start time and finish time for each of the five jobs using each of the following scheduling algorithms. a. FCFS: Start/Finish Times:
A: 0 - 15
B: 15 - 17
C: 17 - 31
D: 31 - 41
E: 41 - 43
b.
SJN: Start/Finish Times:
A: 0 - 15
B: 15 - 17
C: 29 - 34
D: 19 - 29
E: 17 - 19
c.
SRT: Start/Finish Times:
A: 0 - 29
B: 2 - 4
C: 29 - 43
D: 6 - 18
E: 10 - 12
d. Round robin: Start/Finish Times:
A: 0 - 5, 15 - 20, 30 - 35
B: 5 - 10, 20 - 22
C: 10 - 15, 35 - 43
D: 22 - 27
E: 27 - 30
4.
Using the same information given for the previous exercise, compute the turnaround time for
every job using each of the following scheduling algorithms (ignoring context switching
overhead times).
5.
a.
FCFS: A: 15, B: 15, C: 28, D: 35, E: 33
6.
b.
SJN: B: 2, E: 4, A: 19, C: 30, D: 37
7.
c.
SRT: B: 2, E: 4, A: 15, C: 29, D: 39
8.
d. Round robin: A: 43, B: 22, C: 33, D: 27, E: 30
Chapter 5:
9.
Given the ice cream example from the beginning of this chapter, identify the four necessary
conditions for deadlock and explain whether each one is present, or is not present, in this
case.
Mutual exclusion, resource holding, no preemption, and circular wait are all examples of
necessary rules. Neither client can eat the ice cream because the last spoon was given to
one and the last ice cream to the other. Because the ice cream cannot be shared, neither
can eat it. Resource holding shows that ice cream and the spoon are wasted because both
consumers require all resources at the same time to enjoy the ice cream. Therefore, a
stalemate has occurred since both parties are waiting for resources. A no-preemption rule
implies that the shop was unable to obtain the resource from either client, and neither client
was willing to surrender the resource. In order for Circular Wait to occur, they would need to
transfer the allocated resources around to each other.
10. Consider a system with 14 dedicated devices of the same type and all jobs currently running
on this system require a maximum of 5 devices to complete their execution but they each run
for long periods of time with just 3 devices and request the remaining two only at the very
end of the run. Assume that the job stream is endless and that your operating system’s device
allocation policy is a very conservative one: No job will be started unless all the required
drives have been allocated to it for the entire duration of its run.
a.
What is the maximum number of jobs that can be in active at once? Explain your answer.
A maximum of two jobs can be active at once. There are 5 devices allocated to each
job at the beginning of the run, allowing two jobs to be initiated, each requiring five devices. There are four devices that remain unallocated.
b.
What are the minimum and maximum number of devices that may be idle as a result of this policy? Under what circumstances would an additional job be started?
Idle devices must always be at least four because there are always four unallocated devices. The maximum number of idle devices is eight, accounting for the four unallocated devices and two for each job that has not accessed its last two devices. It is only possible to start an additional job when 5 devices are available.
11.
Suppose your operating system is identical to the one described in the question 6 with 14
devices but supports the Banker’s Algorithm.
a.
What is the maximum number of jobs that can be in progress at once? Explain your answer.
With the Banker's Algorithm, a maximum of four jobs can be running at once. Calculated by dividing the total devices by the minimum devices required to complete the job (14/3 = 4.67, rounded down to 4).
b.
What are the minimum and maximum number of devices that may be idle as a result of this policy? Under what circumstances would an additional job be started?
A maximum of four devices may be idle, considering each job requires up to five devices. The minimum number that may be idle occurs when jobs require 5 and 4 devices to run resulting in 1 idle device. If the required resources are available, an additional job can be started.
Chapter 6:
12. Describe the relationship between a process and a thread in a multicore system.
In a multicore system, a process creates and manages threads. A thread belongs to
a process, but processes do not belong to threads. Processes are controlled by the
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
- Access to all documents
- Unlimited textbook solutions
- 24/7 expert homework help