Path: utzoo!mnetor!tmsoft!torsqnt!lethe!yunexus!ists!helios.physics.utoronto.ca!news-server.csri.toronto.edu!cs.utexas.edu!romp!auschs!awdprime!doorstop.austin.ibm.com!tif From: tif@doorstop.austin.ibm.com (Paul Chamberlain) Newsgroups: comp.unix.internals Subject: Re: Help with 4.3 mod to kill uninteruptable procs. Message-ID: <5583@awdprime.UUCP> Date: 25 Feb 91 14:19:50 GMT References: <1991Feb19.001941.29928@lynx.CS.ORST.EDU> <1991Feb21.152845.29019@cbnews.att.com> <5558@awdprime.UUCP> Sender: news@awdprime.UUCP Reply-To: tif@doorstop.austin.ibm.com (Paul Chamberlain) Organization: IBM AWD, Austin Lines: 21 In article <5558@awdprime.UUCP> jfh@greenber.austin.ibm.com (John F Haugh II) writes: >A typical sleep loop looks something like > > while (some_status & some_busy_flag) > sleep (&some_status, PRI_O_MINE); > > some_status |= some_busy_flag; John, perhaps it obvious, but I've seen several places that neglect to do this right, and I don't want it to become anymore widespread. Unless you like drivers that hang sometimes, this is the way it should be: DISABLE_INTERRUPTS; while (some_status & some_busy_flag) sleep (&some_status, PRI_O_MINE); ENABLE_INTERRUPTS; some_status |= some_busy_flag; Paul Chamberlain | I do NOT speak for IBM. IBM VNET: PAULCC AT AUSTIN 512/838-9662 | ...!cs.utexas.edu!ibmchs!auschs!doorstop.austin.ibm.com!tif Brought to you by Super Global Mega Corp .com