From owner-freebsd-hackers Tue Apr 22 12:51:14 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.5/8.8.5) id MAA17696 for hackers-outgoing; Tue, 22 Apr 1997 12:51:14 -0700 (PDT) Received: from sax.sax.de (sax.sax.de [193.175.26.33]) by hub.freebsd.org (8.8.5/8.8.5) with SMTP id MAA17647 for ; Tue, 22 Apr 1997 12:51:08 -0700 (PDT) Received: (from uucp@localhost) by sax.sax.de (8.6.12/8.6.12-s1) with UUCP id VAA16798 for hackers@freebsd.org; Tue, 22 Apr 1997 21:51:06 +0200 Received: (from j@localhost) by uriah.heep.sax.de (8.8.5/8.8.5) id VAA28956; Tue, 22 Apr 1997 21:45:31 +0200 (MET DST) Message-ID: <19970422214531.BX39690@uriah.heep.sax.de> Date: Tue, 22 Apr 1997 21:45:31 +0200 From: j@uriah.heep.sax.de (J Wunsch) To: hackers@freebsd.org Subject: Re: concurrent calls to device drivers References: <199704210727.JAA15119@labinfo.iet.unipi.it> <199704220425.NAA12940@genesis.atrad.adelaide.edu.au> X-Mailer: Mutt 0.60_p2-3,5,8-9 Mime-Version: 1.0 X-Phone: +49-351-2012 669 X-PGP-Fingerprint: DC 47 E6 E4 FF A6 E9 8F 93 21 E0 7D F9 12 D6 4E Reply-To: joerg_wunsch@uriah.heep.sax.de (Joerg Wunsch) In-Reply-To: <199704220425.NAA12940@genesis.atrad.adelaide.edu.au>; from Michael Smith on Apr 22, 1997 13:55:07 +0930 Sender: owner-hackers@freebsd.org X-Loop: FreeBSD.org Precedence: bulk As Michael Smith wrote: > That's ususally the best way to go; something like : > > > sc_busy; > > ... > > fooread(...) > { > ... > > 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. 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. -- cheers, J"org joerg_wunsch@uriah.heep.sax.de -- http://www.sax.de/~joerg/ -- NIC: JW11-RIPE Never trust an operating system you don't have sources for. ;-)