Question: Use c to wrote a simulation program. it must have read from a text config file the following values: a SEED for the random number

Use c to wrote a simulation program. it must have read from a text config file the following values:

  • a SEED for the random number generator
  • INIT_TIME
  • FIN_TIME
  • ARRIVE_MIN
  • ARRIVE_MAX
  • QUIT_PROB
  • NETWORK_PROB
  • CPU_MIN
  • CPU_MAX
  • DISK1_MIN
  • DISK1_MAX
  • DISK2_MIN
  • DISK2_MAX
  • NETWORK_MIN
  • NETWORK_MAX
  • The system runs from INIT_TIME (usually 0) to FIN_TIME.
  • Jobs enter the system with an interarrival time that is uniformly distributed between ARRIVE_MIN and ARRIVE_MAX.
  • Once a job has finished a round of processing at the CPU, the probability that it completes and exits the system (instead of doing a disk read or network send, and then further computation) is QUIT_PROB.
  • Once a job has been determined to continue executing, a probability function is used to determine whether it will do disk I/O or use the network. This probability is NETWORK_PROB.
  • When a job needs to do disk I/O, it uses the disk that's the least busy, i.e., the disk whose queue is the shortest. (This might seem a bit silly, but we can pretend that each disk has the same information.) If the disk queues are of equal length, choose one of the disks at random.
  • When jobs reach some component (CPU, disk1, disk2, or network), if that component is free, the job begins service there immediately. If, on the other hand, that component is busy servicing someone else, the job must wait in that component's queue.
  • The queue for each system component is FIFO.
  • When a job reaches a component (a different job leaves a component or the component is free, and this job is first in the queue), how much time does it spend using the component? This is determined randomly, at runtime, for every component arrival. A job is serviced by a component for an interval of time that is uniformly distributed between some minimum and maximum defined for that component. For example, you'll define: CPU_MIN, CPU_MAX, DISK1_MIN, DISK1_MAX, etc.
  • At time FIN_TIME, the entire job simulation terminates. We can ignore the jobs that might be left receiving service or waiting in queue when FIN_TIME is reached.

Use c to wrote a simulation program. it must have read from

1 2 3 4 while(!isEmpty(&prioq) && (curr_time

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!