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