Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 07 Nov 2004 08:48:39 +0100
From:      "Poul-Henning Kamp" <phk@phk.freebsd.dk>
To:        Matthew Dillon <dillon@apollo.backplane.com>
Cc:        John-Mark Gurney <gurney_j@resnet.uoregon.edu>
Subject:   Re: Multi-threading access to device drivers. 
Message-ID:  <18262.1099813719@critter.freebsd.dk>
In-Reply-To: Your message of "Sat, 06 Nov 2004 19:57:36 PST." <200411070357.iA73vaqU040765@apollo.backplane.com> 

next in thread | previous in thread | raw e-mail | index | archive | help
In message <200411070357.iA73vaqU040765@apollo.backplane.com>, Matthew Dillon writes:
>:As was quoted POSIX, the update should be atomic..  so my reading of
>:that is that you lock the fd, when you read the offset from the fd,
>:you need to also update the offset with the number of bytes read, so
>:that a racing read both doesn't drop any data, nor duplicate any data..
>:
>:i.e.  single file with fixed records, it should be perfectly safe to
>:throw five threads looping doing a read processing of the records w/o
>:fear of duplicate records, or dropped records...
>:
>:And if we handle it in this manner, then you can allow multiple reads
>:into the driver...
>:
>:-- 
>:  John-Mark Gurney				Voice: +1 415 225 5579
>
>    If it's a regular file [...]

BZZZT!  Wrong, but thanks for playing.  (We are talking devices here)

-- 
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.



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