I don't think it matters because I set tickets to 0 when the rmp is IN_USE
is off but I'll add it in just to be safe.


On Sun, Apr 27, 2014 at 12:45 AM, Neil Killeen <notifications@github.com>wrote:

> In schedule.c:
>
> > + * name: lottery                                                               *
> > + * parameters: m_ptr - a message                                               *
> > + * retuns: the index of the process in schedproc who won the lotter            *
> > + * intended action: to select a process to schedule probabaliticly via lottery *
> > + * assumptions: every process has at least one ticket                          *
> > + *=============================================================================*/
> > +PRIVATE size_t lottery(message *m_ptr)
> > +{
> > +    int selection = 42 % ticket_count(); /* TODO replace 42 with the random number generated via dave's method */ /* ticket# 0 to X-1 where X is total number of tickets. */
> > +    size_t winning_process = 0; /* index of the winner in the process table */
> > +    register struct schedproc *rmp;
> > +
> > +    /* subtract off the number of tickects the process' have until
> > +       the selection is found */
> > +    do {
> > +        rmp = &schedproc[winning_process++];
>
> You should check to see that rmp is actually a process.
>
> --
> Reply to this email directly or view it on GitHub<https://github.com/kiLLeen/DNDM/pull/8/files#r12028054>
> .
>