Re: Multi-threading access to device drivers.
From: Poul-Henning Kamp (phk_at_phk.freebsd.dk)
Date: 11/07/04
- Previous message: Matthew Dillon: "Re: Multi-threading access to device drivers."
- In reply to: Garrett Wollman: "Re: Multi-threading access to device drivers."
- Next in thread: Kirk McKusick: "Re: Multi-threading access to device drivers."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
To: Garrett Wollman <wollman@khavrinen.lcs.mit.edu> Date: Sun, 07 Nov 2004 08:45:59 +0100
In message <200411070015.iA70FDxm015465@khavrinen.lcs.mit.edu>, Garrett Wollman writes:
>In article <10847.1099784360@critter.freebsd.dk> you write:
>>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 ?
>
>POSIX is quite clear on the matter:
>
>> All of the functions chmod (), close (), fchmod (), fcntl (), fstat
>> (), ftruncate (), lseek (), open (), read (), readlink (), stat (),
>> symlink ( ), and write ( ) shall be atomic with respect to each other
>> in the effects specified in IEEE Std 1003.1-2001 when they operate on
>> regular files. If two threads each call one of these functions, each
>> call shall either see all of the specified effects of the other call,
>> or none of them.
>
>(One of the "specified effects" is advancing the file offset.)
Yes, but notice the "... when they operate on regular files." bit.
It doesn't say anything about devices.
-- 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. _______________________________________________ freebsd-arch@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-arch To unsubscribe, send any mail to "freebsd-arch-unsubscribe@freebsd.org"
- Previous message: Matthew Dillon: "Re: Multi-threading access to device drivers."
- In reply to: Garrett Wollman: "Re: Multi-threading access to device drivers."
- Next in thread: Kirk McKusick: "Re: Multi-threading access to device drivers."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]