I want to use lottery scheduling to my os

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
User avatar
zhongshu_gu
Posts: 6
Joined: Tue Jan 22, 2008 9:47 pm
Location: Beijing, China

I want to use lottery scheduling to my os

Post 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
User avatar
JamesM
Member
Member
Posts: 2935
Joined: Tue Jul 10, 2007 5:27 am
Location: York, United Kingdom
Contact:

Post 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
molux
Posts: 15
Joined: Fri May 16, 2008 8:36 am

Post by molux »

Hello,

What is the interest of this kind of shceduler ?

Molux
User avatar
Combuster
Member
Member
Posts: 9301
Joined: Wed Oct 18, 2006 3:45 am
Libera.chat IRC: [com]buster
Location: On the balcony, where I can actually keep 1½m distance
Contact:

Post 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.
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
Post Reply