944,088 Members | Top Members by Rank

Ad:
  • C Discussion Thread
  • Unsolved
  • Views: 11518
  • C RSS
Jun 26th, 2005
0

Help me in Round Robin Algorithem& Shortest remaining time next

Expand Post »
Use the CPU trace generator to generate jobs (or process) traces and simulate the
following algorithms
1. Shortest remaining time next (aka Shortest Job First with pre-emption,
aka SJF, shortest next burst time).
2. Round-Robin with user set-able time quantum (the time quantum should
be a userset-able command line parameter. Default time quantum is 20 time
units)
[Hint: aka = also known as]
The CPU trace generated by your CPU trace generator must have the following
format:
? numberOfJobs
? JobId_1 [space] arrivalTime [space] numberofIORequests [space] [Priority]
Followed by
? burstTime_1
? burstTime_2
? burstTime_3
? ...
? JobId_2 [space] arrivalTime [space] numberofIORequests [space] [Priority]
Followed by
? burstTime_1
? burstTime_2
? burstTime_3
? ...
? JobId_numberOfJobs [space] arrivalTime [space] numberofIORequests
[space] [Priority]
Followed by
? burstTime_1
? burstTime_2
? burstTime_3
? ...
An example of a trace file is:
2
1 0 3 1
5
60
19
21
2 3 2 2
5
5
7
Your CPU scheduling simulator should read this trace and simulate the algorithms
listed above. You want to test your program with a mix of 2 - 20 jobs and (the
same) two test cases (traces) for each algorithm:
1. Predominantly I/O bound jobs (interactive)
2. Predominantly CPU bound jobs (batch)
Your simulation should output the following statistics
• Average throughput measured in jobs per time unit
• Average turnaround time measured in time units
• Average waiting time measured in time units
Predominantly I/O bound jobs means the main part of this process/job will be
I/O based. It means the most of the execution time of that process will require
Input/Output from/to user and vise versa for Predominantly CPU bound jobs�.


Clarification:
You are required to submit 3 files; each should accept the following command line
Parameters:
* If not specified, then default quantum size = 20
Trace File
• We are not simulating I/O burst times
• Priority has been excluded
• The ranges for generated values are as follows:
o No. of jobs: Random number between 2 and 20
o Arrival time: There should be between 0-20 time units between job
arrivals
o No. of I/O Requests: Random number between 1 and 20
o No. of CPU Bursts: # of I/O Requests + 1
o Burst Duration: Random number between 1 and 100
(Please note: I/O bound processes will have shorter bursts on average
then CPU bound processes)
An example of a trace file is:
2
1 0 2
5
60
19
2 3 1
5 5
Shortest Remaining Time First
If a process P1 is running and a new process enter the ready queue, allow P1 to
run again, i.e. include it in the processes in contention.
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
Naseer is offline Offline
1 posts
since Jun 2005
Jun 30th, 2005
0

Re: Help me in Round Robin Algorithem& Shortest remaining time next

Please post your own work. This is a homework assignment-- it's obvious from the way it's phrased.
Team Colleague
Reputation Points: 186
Solved Threads: 147
Cookie... That's it
alc6379 is offline Offline
2,519 posts
since Dec 2003

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in C Forum Timeline: linked stack question.
Next Thread in C Forum Timeline: Template in *.h or *.cpp





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC