Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add print_stats to lottery.c to show the result statistics #3

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

serdarkacka
Copy link

By calling print_stats() before the exit of the program we can see that the scheduler does a fair scheduling according to tickets of the jobs.

For example when running

./lottery 1 100000

from command line, the results printed by print_stats() are

Stats:
[25]: 14.210 %
[100]: 57.180 %
[50]: 28.610 %

So we can see that there is a fair scheduling going on in this program.

We can add more jobs with insert(), and the program does not break working well with these modifications too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant