Page 1 of 1

I want to use lottery scheduling to my os

Posted: Tue May 20, 2008 11:03 pm
by zhongshu_gu
I used to implement a simple round robin scheduling. Now I want to change it to lottery scheduling. But how can I make sure that every process will have the right to be executed? As it only depends on the randomized method of choosing process. What if some process that always has no chance to be chosen?
And another question is what is the random method should I choose to make it schedule better? In the paper, it use Park Miller random generator, but what is the seed I can choose to generate as it is a pseudo random generator.
Thanks

Posted: Wed May 21, 2008 1:51 am
by JamesM
Hi,

Unless your random number generator can be proved mathematically to be at least pseudo-random, I can't see how you will avoid possible starvation.

A good seed to use, however, is the system time (stored in the RTC).

Cheers,

James

Posted: Wed May 21, 2008 2:48 am
by molux
Hello,

What is the interest of this kind of shceduler ?

Molux

Posted: Wed May 21, 2008 4:27 am
by Combuster
molux wrote:What is the interest of this kind of shceduler ?
Unless the OP is trying some Monte-Carlo or Vegas algorithm, I can't think of any real use - in fact I would steer clear of it as the (semi-)starvation you get is IMO an undesirable property.