Answered step by step
Verified Expert Solution
Question
1 Approved Answer
C Program Well Documented Giorgio's Discrete Event Simulator Description The programs that we execute require different services from our machines at different times: sometimes they're
C Program Well Documented
Giorgio's Discrete Event Simulator Description The programs that we execute require different services from our machines at different times: sometimes they're crunching numbers using the CPU.Other times,they read from a disk or network device. Still other times they're doing nothing but waiting for something to happen, for example: a disk read to finish, a packet to arrive from a network device, a user to click on something with a mouse, or simply waiting for some other running program to finish using some needed component. In this assignment, you'll create a discrete event simulation in C that models the very simplified machine pictured. Some additional information about discrete event simulation is at Supplemental Information: Discrete Event Simulation Problem INPUT CPU OUTPUT disk2 The purpose of the assignment is to gain some understanding of how processes move through a computing system and to put into practice some things that you've learned in 2107 and 2168, but might not have had a chance to use in a while. When a job arrives (perhaps because a user double-clicked on an icon to start a program), it needs to spend some amount of time executing using the CPU. It then either performs I/O on one of two disks and returns to use the CPU, or the job is finished. Jobs alternate between the CPU and I/O devices in this manner until they're finished. It's possible that when a job arrives to use a device, the device is busy servicing another program. In this case, the job must wait in a queue until the device is no longer busy. In this assignment, all of your device queues are FIFO, however, this is not necessarily the case in real systems. For this assignment, we'll frequently note or record the time: however, we'll use a "logical clock" and think of things in terms that sound like, "at time 37,job 6 spent 5 units of time at the CPU" rather than "at 2:30:01 PM, job 6 spent 300 microseconds at the CPU n your simulation, the amount of time that a job spends using the CPU, whether or not it's finished (has more computing), which disk contains the file a job needs, and many other properties are determined at runtime, at random. To generate random numbers in C, take a look at the Standard C Library functions rand) and srand) (so that your program doesn't use the same pseudo-random numbers in each run). Giorgio's Discrete Event Simulator Description The programs that we execute require different services from our machines at different times: sometimes they're crunching numbers using the CPU.Other times,they read from a disk or network device. Still other times they're doing nothing but waiting for something to happen, for example: a disk read to finish, a packet to arrive from a network device, a user to click on something with a mouse, or simply waiting for some other running program to finish using some needed component. In this assignment, you'll create a discrete event simulation in C that models the very simplified machine pictured. Some additional information about discrete event simulation is at Supplemental Information: Discrete Event Simulation Problem INPUT CPU OUTPUT disk2 The purpose of the assignment is to gain some understanding of how processes move through a computing system and to put into practice some things that you've learned in 2107 and 2168, but might not have had a chance to use in a while. When a job arrives (perhaps because a user double-clicked on an icon to start a program), it needs to spend some amount of time executing using the CPU. It then either performs I/O on one of two disks and returns to use the CPU, or the job is finished. Jobs alternate between the CPU and I/O devices in this manner until they're finished. It's possible that when a job arrives to use a device, the device is busy servicing another program. In this case, the job must wait in a queue until the device is no longer busy. In this assignment, all of your device queues are FIFO, however, this is not necessarily the case in real systems. For this assignment, we'll frequently note or record the time: however, we'll use a "logical clock" and think of things in terms that sound like, "at time 37,job 6 spent 5 units of time at the CPU" rather than "at 2:30:01 PM, job 6 spent 300 microseconds at the CPU n your simulation, the amount of time that a job spends using the CPU, whether or not it's finished (has more computing), which disk contains the file a job needs, and many other properties are determined at runtime, at random. To generate random numbers in C, take a look at the Standard C Library functions rand) and srand) (so that your program doesn't use the same pseudo-random numbers in each run)
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started