From owner-freebsd-hackers Tue Apr 22 19:27:59 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.5/8.8.5) id TAA26677 for hackers-outgoing; Tue, 22 Apr 1997 19:27:59 -0700 (PDT) Received: from genesis.atrad.adelaide.edu.au (genesis.atrad.adelaide.edu.au [129.127.96.120]) by hub.freebsd.org (8.8.5/8.8.5) with ESMTP id TAA26672 for ; Tue, 22 Apr 1997 19:27:56 -0700 (PDT) Received: (from msmith@localhost) by genesis.atrad.adelaide.edu.au (8.8.5/8.7.3) id LAA18664; Wed, 23 Apr 1997 11:57:14 +0930 (CST) From: Michael Smith Message-Id: <199704230227.LAA18664@genesis.atrad.adelaide.edu.au> Subject: Re: concurrent calls to device drivers In-Reply-To: <19970422214531.BX39690@uriah.heep.sax.de> from J Wunsch at "Apr 22, 97 09:45:31 pm" To: joerg_wunsch@uriah.heep.sax.de Date: Wed, 23 Apr 1997 11:57:14 +0930 (CST) Cc: hackers@freebsd.org X-Mailer: ELM [version 2.4ME+ PL28 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-hackers@freebsd.org X-Loop: FreeBSD.org Precedence: bulk J Wunsch stands accused of saying: > > > > s = splfoo(); > > while(sc->sc_busy) { > > What's the splfoo() for? > > Unless the interrupt service can modify sc_busy, you don't need to > protect it. I was thinking explicitly about the speaker driver when I wrote this; in particular I was thinking that, presuming I get around to actually doing what I had planned, it would take the data from the first caller, and return as soon as it had buffered everything that was offered to it. Other writers would still be sleeping on the busy flag, but then further down the sample my mind wandered 8) > You gotta do a > > obtain_mp_lock(); > while(sc->sc_busy) { > ... > } > release_mp_lock(); > > however. :-) On a uniprocessor however, only one process can be in > the kernel at a time. Do we have sample implementations of these primitives? Last I heard the SMP kernel wasn't doing kernel reentrancy yet, so I guess it's not vital yet... -- ]] Mike Smith, Software Engineer msmith@gsoft.com.au [[ ]] Genesis Software genesis@gsoft.com.au [[ ]] High-speed data acquisition and (GSM mobile) 0411-222-496 [[ ]] realtime instrument control. (ph) +61-8-8267-3493 [[ ]] Unix hardware collector. "Where are your PEZ?" The Tick [[