proc.c
// function to sum the the tickets of process --> mohamed ali
function to sum the the tickets of process --> mohamed ali
function to sum the the tickets of process -- > mohamed ali
int
lottery_total(void){
  struct proc *p;
  int ticket_aggregate=0; 
  for(p = ptable.proc; p < &ptable.proc[NPROC]; p++)
  {
    if(p->state==RUNNABLE){
      ticket_aggregate+=p->tickets;
    }
  }
  return ticket_aggregate;          
}
int lottery_total ( void ) { struct proc * p ; int ticket_aggregate = 0 ; for ( p = ptable . proc ; p < & ptable . proc [ NPROC ] ; p ++ ) { if ( p -> state == RUNNABLE ) { ticket_aggregate += p -> tickets ; } } return ticket_aggregate ; }
function to sum the the tickets of process --> mohamed ali
function to sum the the tickets of process -- > mohamed ali
// counter //loop over process table and increment total tickets if a runnable process is found  // returning total number of tickets for runnable processes