Skip site navigation (1)Skip section navigation (2)
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
Message-ID:  <19970422214531.BX39690@uriah.heep.sax.de>
In-Reply-To: <199704220425.NAA12940@genesis.atrad.adelaide.edu.au>; from Michael Smith on Apr 22, 1997 13:55:07 %2B0930
References:  <199704210727.JAA15119@labinfo.iet.unipi.it> <199704220425.NAA12940@genesis.atrad.adelaide.edu.au>

next in thread | previous in thread | raw e-mail | index | archive | help
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. ;-)



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?19970422214531.BX39690>