Date: Sat, 06 Nov 2004 16:15:15 -0800 From: Kirk McKusick <mckusick@mckusick.com> To: Poul-Henning Kamp <phk@phk.freebsd.dk> Cc: arch@freebsd.org Subject: Re: Multi-threading access to device drivers. Message-ID: <200411070015.iA70FFCW074582@beastie.mckusick.com> In-Reply-To: Your message of "Sun, 07 Nov 2004 00:39:20 %2B0100."
next in thread | raw e-mail | index | archive | help
> To: arch@freebsd.org > From: Poul-Henning Kamp <phk@phk.freebsd.dk> > Date: Sun, 07 Nov 2004 00:39:20 +0100 > Subject: Multi-threading access to device drivers. > X-ASK-Info: Whitelist match > > Assume a device driver which is not Giant-handicapped. > > Assume an I/O path which does not need Giant to get from > read(2) to the device driver. > > Assume a SMP machine. > > Assume a process with two threads on two CPUs, both > doing read(fd, buf, len) at the same time. > > Should we let both reads into the driver at the same time ? > > If so, which uio_offset do we hand them ? > > -- > Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 > phk@FreeBSD.ORG | TCP/IP since RFC 956 > FreeBSD committer | BSD since 4.3-tahoe > Never attribute to malice what can adequately be explained by incompetence. Historically, reads on a file descriptor are serialized. I believe that they still should. An an example, if two threads are trying to read a stream of commands, then they should not both get the same one as the above example would allow. Kirk McKusick
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200411070015.iA70FFCW074582>
