Basic Concept: Tickets Represent Your Share
This lesson briefly explains the basic concept of lottery scheduling.
We'll cover the following
Underlying lottery scheduling is one very basic concept: tickets, which are used to represent the share of a resource that a process (or user or whatever) should receive. The percent of tickets that a process has represents its share of the system resource in question.
Example
Let’s look at an example. Imagine two processes, and , and further that has 75 tickets while has only 25. Thus, what we would like is for to receive 75% of the CPU and the remaining 25%.
Lottery scheduling achieves this probabilistically (but not deterministically) by holding a lottery every so often (say, every time slice). Holding a lottery is straightforward: the scheduler must know how many total tickets there are (in our example, there are 100). The scheduler then picks a winning ticket, which is a number from 0 to 99.
Get hands-on with 1400+ tech skills courses.