Thread: round robin algorithm!

  1. #1
    Registered User
    Join Date
    Sep 2005
    Posts
    22

    round robin algorithm!

    Hi to all,

    Can anyone give me the C source code of the round robin algorithm?

    Also where can I find the source codes of other algorithms like weighted round robin..? Is there a link where i can dwld them?

    If anyone has it, pls post it...

    Warm regards,
    Visham

  2. #2
    Sr. Software Engineer filker0's Avatar
    Join Date
    Sep 2005
    Location
    West Virginia
    Posts
    235
    Do you mean round robin scheduling, where each member of the run-list gets a quanta of time until they've all gotten time, then you do it again? Also, by weighted, do you mean priority based? Static or dynamic priority?

    This is a complex subject, though the concepts are fairly simple. I'd suggest you look at an operations research textbook or an operating system internals text.

  3. #3
    Gawking at stupidity
    Join Date
    Jul 2004
    Location
    Oregon, USA
    Posts
    3,218
    Or just do a google search...

    For future reference: http://www.catb.org/~esr/faqs/smart-questions.html

    Use tactics like doing a Google search on the text of whatever error message you get (and search Google groups as well as web pages). This might well take you straight to fix documentation or a mailing list thread that will answer your question. Even if it doesn't, saying “I googled on the following phrase but didn't get anything that looked useful” is a good thing to be able to put in email or news postings requesting help.
    You're not getting error messages, but you could at least show that you've tried to do something on your own.
    Last edited by itsme86; 10-11-2005 at 12:59 PM.
    If you understand what you're doing, you're not learning anything.

  4. #4
    Registered User
    Join Date
    Oct 2005
    Posts
    53
    [QUOTE=itsme86]For future reference: http://www.catb.org/~esr/faqs/smart-questions.html

    QUOTE]

    What does the website mean by 'hackers' and 'hacker circles'? I think I have a different definition that of the website's

  5. #5
    Gawking at stupidity
    Join Date
    Jul 2004
    Location
    Oregon, USA
    Posts
    3,218
    The very first instance of "hacker" on that same website is a link to: http://www.catb.org/~esr/faqs/hacker-howto.html

    You'll find that the internet is an astounding research tool once you learn how to use it.
    If you understand what you're doing, you're not learning anything.

  6. #6
    Registered User
    Join Date
    Oct 2005
    Posts
    53
    The manual is really helpful, thanks for your great ideas!

  7. #7
    Registered User
    Join Date
    Sep 2005
    Posts
    22
    Hi,

    To filker0:
    yes round robin scheduling..and weighted for both static n dynamic priorities..

    To itsme86:
    i already tried google loads of time..but didn't get the C source code..that's why i turned towards you guys as "gateway of last resort"..

    So if you have it, pls post it for me..
    Thx in advance..

    Regards,
    Visham

  8. #8
    ATH0 quzah's Avatar
    Join Date
    Oct 2001
    Posts
    14,826
    Yeah, that'll happen. We're not here to do everything for you. Where's your attempt at it? Or are you just lazy? Don't bother, that was rhetorical.


    Quzah.
    Hope is the first step on the road to disappointment.

  9. #9
    Sr. Software Engineer filker0's Avatar
    Join Date
    Sep 2005
    Location
    West Virginia
    Posts
    235

    Round Robin Scheduling Resources

    I don't have time to write a round-robin scheduler to post, but I'll point you to some on-line resources on the topic that may be of assistance. The Linux kernel implements a round-robin scheduler (as one of the schedulers that it uses), as does the Minix kernel (which is a much smaller OS, hence much simpler code).

    http://www.oreilly.com/catalog/linux...pter/ch10.html discusses the Linux scheduler and may contain pointers to the source files within a Linux source tree.

    http://www.cs.vu.nl/~ast/getting_minix.html Andrew Tannenbaum's MINIX website. The source and documentation for that OS (which was designed to teach people how to write operating system kernels) is available through that link.

    http://kb.linuxvirtualserver.org/wik...bin_Scheduling has a description of the weighted algorithm, some pseudo-code, and some releated material.

    I believe you will find that the actual implementation of any process scheduler will be rather non-generic, as it depends on the structure of a process/task and the preemption/blocking model of the underlying monitor/kernel.

    I hope this helps. If not, I'll see if I can locate pointers to more complete coverage of the topic. (My wife has just gone into early stage labour, so I suspect that I'll not be able to spend much time looking for a few days, at least.)

  10. #10
    Registered User
    Join Date
    Sep 2005
    Posts
    22
    To filker0:

    Many many thx for the links..i'll check them out right away..at least you have posted with a view to help me out; unlike some who just talk and, I believe, post only to increase their post count..

    Profuse thx to all those who have contributed "positively" to this thread..

    Warm regards,
    Visham

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. About aes
    By gumit in forum C Programming
    Replies: 13
    Last Post: 10-24-2006, 03:42 PM
  2. Round Robin Scheduling using c.
    By eclipt in forum C Programming
    Replies: 8
    Last Post: 12-28-2005, 04:58 PM
  3. Almost finished with Round Robin algorithm
    By Shinobi-wan in forum C++ Programming
    Replies: 2
    Last Post: 12-19-2004, 03:00 PM
  4. Binary Search Trees Part III
    By Prelude in forum A Brief History of Cprogramming.com
    Replies: 16
    Last Post: 10-02-2004, 03:00 PM