> Not to be overly annoying, but _is_ it possible that between the
> assignment and that test, p->mach is set, indicating another CPU took
> over? It just doesn't seem like m->readied is locked, at all; it seems
> like another CPU could pick it up in the middle.

Many things are possible.  m->readied is just a hint.
p->mach is just a hint unless you hold the scheduling lock.

That's why dequeueproc double-checks:
    All the accesses in the if condition are just fine --
    they happen without a lock but dequeueproc double-checks
    that p is okay to schedule.

Russ

Reply via email to