Hacktoberfest-2k18 icon indicating copy to clipboard operation
Hacktoberfest-2k18 copied to clipboard

Round-robin process scheduling

Open Ram-Aditya opened this issue 6 years ago • 10 comments

Description

  • Implement the round robin process scheduling algorithm with a time quantum of 2 microseconds.

  • The input to your algorithm must be a 2-D array that contains values for 'Burst Time' and 'Arrival Time', for 20 processes. Initialize random values for each of the 2 attributes for each process and print this table.

  • The expected output must contain the following details:

    • The order in which processes were scheduled.
    • At what time each process was scheduled.
    • Waiting time for each process ( The total amount of time the process spent waiting in the ready queue.)
    • Turn-around time for each process ( The total amount of time from arrival till completion.)
    • The total number of context switches.
  • The acceptable range of values for input: Burst Time: [0,10]microseconds Arrival Time: [0,50]seconds *Burst Time is the amount of time the process requires to execute on the CPU.

Details

  • Technical Specifications:
    • A total of 4 implementations will be accepted.
  • Type of issue: No more than one implementation will be accepted for each language. Once the implementation for a language has been taken up you must choose a different language.
  • Time Limit: The claim for the issues will be given on a first-come, first-serve basis. Once you take this issue up in a particular language, you must complete it within 3 days, failing which the issue will be allocated to the next person who requested for this issue.
  • Additional Instructions:
    • While making the Pull Request, attach screenshots of 5 sample inputs and their corresponding output.

Issue Progress - Languages that have been claimed

Will be updated as and when the issue is claimed.

Resources

https://www.tutorialspoint.com/operating_system/os_process_scheduling_algorithms.htm

Directory Structure

For this issue, use the following directory of the Hacktoberfest-2k18 repository: /systems/os/process_scheduling/rr/language_name (where language_name is one of the languages mentioned above.)

Note

Please claim the issue first by commenting here before starting to work on it. Please mention in which language you would like to implement the program in.

Ram-Aditya avatar Oct 18 '18 09:10 Ram-Aditya

I'm gonna give this a try in C++

1337M0nst3r avatar Oct 18 '18 17:10 1337M0nst3r

@1337M0nst3r Yes sure. Please make sure to submit within 3 days.

Ram-Aditya avatar Oct 19 '18 09:10 Ram-Aditya

@Ram-Aditya how should the program take input?

1337M0nst3r avatar Oct 19 '18 16:10 1337M0nst3r

@1337M0nst3r You can initialize a 2-D array which contains Burst Time and Arrival Time for 20 processes with random values that belong to the acceptable ranges, which has been mentioned in the issue description.

Ram-Aditya avatar Oct 19 '18 16:10 Ram-Aditya

@Ram-Aditya so I just create an array like described above each time to program is run?

1337M0nst3r avatar Oct 19 '18 16:10 1337M0nst3r

@1337M0nst3r Yes.

Ram-Aditya avatar Oct 19 '18 16:10 Ram-Aditya

@Ram-Aditya thanks, I thought I got it wrong

1337M0nst3r avatar Oct 19 '18 16:10 1337M0nst3r

@Ram-Aditya sorry to bother you again but what did you mean by "at what time each process was scheduled"?

1337M0nst3r avatar Oct 20 '18 14:10 1337M0nst3r

@1337M0nst3r A process can either be in the ready queue, i.e it has already arrived but is waiting for another process which is already executing to let go of CPU, or has been "scheduled" and is using the CPU. In a round-robin scheduling scenario, when a process's turn arrives, it will be scheduled and when it finishes executing on the CPU for a time interval equal to time quantum, it will be put back into the ready queue. Thus a single process may be given CPU access or will be "scheduled" multiple times ( i.e until the cumulative sum of its execution time on the CPU is equal to its burst time.). These times at which it was given CPU access or "scheduled" is what is meant by "at what time each process was scheduled". Feel free to reach out in case of further doubts.

Ram-Aditya avatar Oct 20 '18 15:10 Ram-Aditya

@Ram-Aditya thanks for help!

1337M0nst3r avatar Oct 20 '18 16:10 1337M0nst3r