Giving tickets to the each processors. Regarding the tickets the Schedular pick the process. Here it will gives non-zero probability of being selected by the schedular operation.
Ways to Manipulate tickets
Ticket Currency
Currency allows a user with a set of tickets to allocate tickets among own jobs in whatever currency they would like the system then automatically converts said currency into the correct global value.
Transfer Tickets
A process can pass it tickets to another process.
Ticket inflation
A process can temporarily raise or lower the number of tickets it own.
Code
// counter: used to track if we’ve found the winner yet
2 int counter = 0;
3
4 // winner: use some call to a random number generator to
5 // get a value, between 0 and the total # of tickets
6 int winner = getrandom(0, totaltickets);
7
8 // current: use this to walk through the list of jobs
9 node_t *current = head;
10
11 // loop until the sum of ticket values is > the winner
12 while (current) {
13 counter = counter + current->tickets;
14 if (counter > winner)
15 break; // found the winner
16 current = current->next;
17 }
18 // ’current’ is the winner: schedule it...