hatfield-c / xv6-project2

The second project for the xv6 operating system. Must replace the Round Robin scheduler with a lottery scheduler.
1 stars 0 forks source link

[LOT-5] A lottery scheduler will replace the round robin scheduler #5

Closed hatfield-c closed 5 years ago

hatfield-c commented 5 years ago

The logic for loading processes is fairly contained, and can be placed inside of whatever condition controls lottery success. Thus, the challenge for developing the lottery system becomes keeping track of the number of tickets active at any given moment, and determining when the lottery "hits".

We can use a for loop to go through all the processes, determining if their tickets match the winning number as we go along, so we only need to worry about a "maximum" number so that our generator doesn't spend most of its time throwing numbers without associated processes.

The easiest way to determine the max number of tickets per lottery, would be to loop over the process table during each lottery to determine the number of "active tickets" at any given time. After that, the number generator can do its thing with its new max value, and then the lottery can loop through the processes again to determine a winner.

hatfield-c commented 5 years ago

This issue is now complete, and is available on the branch LOT-5. Please QA on that branch, and have a nice day. :)

hatfield-c commented 5 years ago

This issue has passed QA, and the branch LOT-5 has been merged with master.

hatfield-c commented 5 years ago

This issue is now finished, and will be closed.