Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 21 Apr 1997 09:27:37 +0200 (MET DST)
From:      Luigi Rizzo <luigi@labinfo.iet.unipi.it>
To:        msmith@atrad.adelaide.edu.au (Michael Smith)
Cc:        hackers@freebsd.org
Subject:   concurrent calls to device drivers
Message-ID:  <199704210727.JAA15119@labinfo.iet.unipi.it>
In-Reply-To: <199704210613.PAA08016@genesis.atrad.adelaide.edu.au> from "Michael Smith" at Apr 21, 97 03:43:31 pm

next in thread | previous in thread | raw e-mail | index | archive | help
[previous thread about possible bug in /dev/spkr ]

> The driver claims to only permit a single opener, which as Bruce has 
> pointed out before is pointless as fd's are duplicated across forks.

which reminds me that many device drivers in /sys/i386/isa (some
of which were contributed by me... :( ) are "broken" in the same
way: they keep a flag to remember that the device is open, but do
not prevent concurrent calls, assuming the single open as a guarantee
that there are no concurrent calls. The assumption is false not
only because of forks, but presumably also when threads are used.

At a quick glance the involved devices in /sys/i386/isa are

	pcaudio, bqu (transputer), asc, gsc, gpib, joy, qcam

Perhaps devices should keep a "busy" flag to prevent concurrent
calls, rather than limiting to insure a single open.

BTW enabling concurrent opens would be kind of useful in some
situations; as an example, once (on a couple of DEC with AudioFile) I
set up a very simple Internet-phone application with the following:

	auread | rsh remotehost auplay &
	rsh remotehost auread | auplay &

where auread/auplay are the applications to read/write to the audio
device. The same would be possible if we allowed multiple opens to full
duplex audio devices (assuming we had a working one...).

Perhaps this ought to be a PR ?

	Cheers
	Luigi
-----------------------------+--------------------------------------
Luigi Rizzo                  |  Dip. di Ingegneria dell'Informazione
email: luigi@iet.unipi.it    |  Universita' di Pisa
tel: +39-50-568533           |  via Diotisalvi 2, 56126 PISA (Italy)
fax: +39-50-568522           |  http://www.iet.unipi.it/~luigi/
_____________________________|______________________________________



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