From mboxrd@z Thu Jan 1 00:00:00 1970 To: 9fans@cse.psu.edu Subject: Re: [9fans] Re: [sources] 20070413: /rc/bin/cpurc.local From: "Russ Cox" Date: Tue, 17 Apr 2007 01:21:16 -0400 In-Reply-To: <9ab217670704151334k121fbbffp426cd8c379848bad@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Message-Id: <20070417052050.13DC11E8C3A@holo.morphisms.net> Topicbox-Message-UUID: 49d8608e-ead2-11e9-9d60-3106f5b1d025 > 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