round robin scheduler

R

rhitx

Can somebody please give like an overview how to do a round robin
scheduler..
I know that we're suppose to use a quantum/quanta? Is this going to be
like an int, then assign with with a value?

And do I implement the READY queue? Can I do it with an array of ints
then somewhat put it at the end of the array?

Please advise.
 
H

Hubble

rhitx said:
Can somebody please give like an overview how to do a round robin
scheduler..
I know that we're suppose to use a quantum/quanta? Is this going to be
like an int, then assign with with a value?

And do I implement the READY queue? Can I do it with an array of ints
then somewhat put it at the end of the array?

Please advise.

Round Robin schedulers are usually implemented as circular lists of
process structs. The process struct contains a quantum. Use "typedef
int quantum_t" if you are unsure. If you use one CPU, use pointer to
the current RUNNING process. All other processes in the scheduler are
READY. After some time (use alarm(2) and catch the signal), advance to
the next READY process in the circular list, which then becomes the
running process.

Hubble.
 
C

Chris Johnson

rhitx said:
Can somebody please give like an overview how to do a round robin
scheduler..
I know that we're suppose to use a quantum/quanta? Is this going to be
like an int, then assign with with a value?

And do I implement the READY queue? Can I do it with an array of ints
then somewhat put it at the end of the array?

Please advise.

This is not the best place to ask these questions, especially since you
haven't translated your problem into C. I'm sure there are OS or
algorithms programming newsgroups where these questions would be more
appropriate.

And my primary advice would be to read your textbook and don't ask
others to do your homework for you. It should have a decent overview of
what things are, which ought to be enough to get you started.

But a couple hints in any case:
Your ready queue is going to be a list of processes, which should have
some internal representation already. So you won't want an array of
ints, but a queue of processes.
And quanta, if I remember properly, are the cutoffs at which you make
the context switch.
 
R

rhitx

Thanks Hubble for the clarification.

Chris said:
This is not the best place to ask these questions, especially since you
haven't translated your problem into C. I'm sure there are OS or
algorithms programming newsgroups where these questions would be more
appropriate.

And my primary advice would be to read your textbook and don't ask
others to do your homework for you. It should have a decent overview of
what things are, which ought to be enough to get you started.

But a couple hints in any case:
Your ready queue is going to be a list of processes, which should have
some internal representation already. So you won't want an array of
ints, but a queue of processes.
And quanta, if I remember properly, are the cutoffs at which you make
the context switch.
 
J

jaysome

Can somebody please give like an overview how to do a round robin
scheduler..
I know that we're suppose to use a quantum/quanta? Is this going to be
like an int, then assign with with a value?

I don't know, because this is comp.lang.c. Do you have a question
about C?
And do I implement the READY queue? Can I do it with an array of ints
then somewhat put it at the end of the array?

I don't know, because this is comp.lang.c. Do you have a question
about C?
Please advise.

My advice is to ask a question about C next time you post here.

Happy travels
 
D

dcorbit

Here is one way:
http://cap.connx.com/tournament_software/roundrobin.c

Probably, you would be a lot better off to ask in other forums.

If you are looking for sources, then perhaps is worth a try
If you are looking for algorithms then is a good
choice

A sourceforge search will turn up tournament scheduling programs.

Generally, is not a place to discuss how to make a
certain kind of software tool. It is a way to discover intricacies of
the C language itself.

Probably, a google search will be a good idea. Or a wikipedia search.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top