From mboxrd@z Thu Jan 1 00:00:00 1970 From: jmk@plan9.bell-labs.com To: 9fans@cse.psu.edu Subject: Re: [9fans] Performance MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Message-Id: <20010511135552.0DB18199D7@mail.cse.psu.edu> Date: Fri, 11 May 2001 09:52:39 -0400 Topicbox-Message-UUID: 9f1bec40-eac9-11e9-9e20-41e7f4b1d025 On Fri May 11 04:42:36 EDT 2001, DAGwyn@null.net wrote: > jmk@plan9.bell-labs.com wrote: > > I think the correct kludge is to wait for the clock interrupt. > > Also the most portable. You learn something new every day. Charles Forsyth pointed out to me that had I read the x86 description of the STI command as well as HLT I would see there is no possibility of an interrupt occurring between the sequence STI HLT as the STI allows interrupts to be responded to after the completion of the following instruction, and HLT is deemed to have completed when it enters its halt state. Therefore, I think a possible way to close the window on the x86 is TEXT halt(SB), $0 CLI CMPL nrdy(SB), $0 JEQ _nothingready STI RET _nothingready: STI HLT RET Whether this is coded correctly or makes a difference is left as an exercise for the student. --jim