Skip to content
This repository has been archived by the owner on Oct 31, 2019. It is now read-only.

Add process scheduling #259

Closed
wants to merge 3 commits into from
Closed

Add process scheduling #259

wants to merge 3 commits into from

Conversation

1337M0nst3r
Copy link
Contributor

Resolves Issue #242

Description

Implemented round robin process scheduling algorithm

Technical Specifications

Made in C++

Screenshots (if required)

2018-10-21-193732_1366x768_scrot
2018-10-21-193740_1366x768_scrot
2018-10-21-193749_1366x768_scrot
2018-10-21-193755_1366x768_scrot
2018-10-21-193805_1366x768_scrot

How to run

Open systems/os/process_scheduling/rr/c++/rr.cpp in any C++ IDE and press build & run OR open a terminal go to systems/process_scheduling/rr/c++/ and type: g++ rr.cpp && ./a.out then press enter

Checklist

  • [x ] Code compiles correctly.
  • [x ] Changes are tested properly.
  • [x ] Followed the Contributing guidelines.

@Ram-Aditya
Copy link
Collaborator

Ram-Aditya commented Oct 22, 2018

@1337M0nst3r Are you sure you have implemented the algorithm correctly? Consider your first example.

  • Many processes do not have the schedule times.
  • Why does Process 0 have a waiting time of 32microseconds? Let the time start from 0microseconds. Now, what is actually supposed to happen for process 0 is as follows: Process 0 arrives at time 0microseconds and is given access to CPU. Thus it is first scheduled at time 0microseconds. It executed on CPU for a time quantum of 2 microseconds. Now the time is 2 microseconds. No other process has arrived yet. Thus process 0 is given access to CPU again and executed on the CPU for 1microsecond and terminates. This is because the cumulative time it has executed on the CPU is 3 microseconds which is equal to its burst time. Thus its waiting time is 0 microseconds. and schedule times are 0 and 2 microseconds as it was scheduled the first time at 0 microseconds and then again at 2 microseconds.

These are a few of the many issues with the implementation. Kindly recheck your implementation and feel free to clear any confusions/misinterpretations that may have been the cause of the issues.

@1337M0nst3r
Copy link
Contributor Author

I can fix the schedule times problem but you said to initialize the processes's arrival time with random values between 0 and 50s what's their purpose?

@1337M0nst3r
Copy link
Contributor Author

Nevermind I got it, now what should I do? Create another pull request?

@Ram-Aditya
Copy link
Collaborator

@1337M0nst3r Yes, please create a new PR.

@Ram-Aditya Ram-Aditya closed this Oct 24, 2018
@Ram-Aditya Ram-Aditya added the invalid This doesn't seem right label Oct 24, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
invalid This doesn't seem right
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants