Multi-threading access to device drivers.
Kirk McKusick
mckusick at mckusick.com
Sat Nov 6 16:15:37 PST 2004
> To: arch at freebsd.org
> From: Poul-Henning Kamp <phk at 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 at 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
More information about the freebsd-arch
mailing list