From mboxrd@z Thu Jan 1 00:00:00 1970 To: 9fans@cse.psu.edu Subject: Re: [9fans] Performance From: Richard Miller MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Message-Id: Date: Wed, 9 May 2001 15:47:41 +0100 Topicbox-Message-UUID: 9c5bb5e4-eac9-11e9-9e20-41e7f4b1d025 > Of course, on a multiprocessor, something can be put on the run > queue by another processor without an external event occurring on > this processor, so the HLT instruction isn't used in that case. Isn't there a race condition here even on a uniprocessor? The scan of the run queue and call to HLT are done with interrupts enabled: - scheduler scans run queue, finds no ready process - scheduler calls halt() - interrupt occurs, placing process P on the run queue - halt() executes HLT instruction - dispatch of process P is delayed until (worst case) the next clock interrupt -- Richard