WebClub-NITK / Hacktoberfest-2k18

Repository for Hacktoberfest 2018 open for the global open source community.
https://webclub-nitk.github.io/Hacktoberfest-2k18/
19 stars 104 forks source link

Round-robin process scheduling #242

Open Ram-Aditya opened 5 years ago

Ram-Aditya commented 5 years ago

Description

Details

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.

1337M0nst3r commented 5 years ago

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

Ram-Aditya commented 5 years ago

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

1337M0nst3r commented 5 years ago

@Ram-Aditya how should the program take input?

Ram-Aditya commented 5 years ago

@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.

1337M0nst3r commented 5 years ago

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

Ram-Aditya commented 5 years ago

@1337M0nst3r Yes.

1337M0nst3r commented 5 years ago

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

1337M0nst3r commented 5 years ago

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

Ram-Aditya commented 5 years ago

@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.

1337M0nst3r commented 5 years ago

@Ram-Aditya thanks for help!