From: Matt <dirtbird@ntlworld.com>
To: Andrew Morton <akpm@osdl.org>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: VFS locking: f_pos thread-safe ?
Date: Fri, 06 Feb 2004 09:26:36 +0000 [thread overview]
Message-ID: <40235DCC.2060606@ntlworld.com> (raw)
In-Reply-To: <20040206011630.42ed5de1.akpm@osdl.org>
Andrew Morton wrote:
>Matt <dirtbird@ntlworld.com> wrote:
>
>
>>>Werner Almesberger <wa@almesberger.net> wrote:
>>>
>>>
>>>>"[...] read( ) [...] shall be atomic with respect to each other
>>>> in the effects specified in IEEE Std. 1003.1-200x 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."
>>>>
>>>>
>>>Whichever thread finishes its read last gets to update f_pos.
>>>
>>>
>>>I'm struggling a bit to understand what they're calling for there. If
>>>thread A enters a read and then shortly afterwards thread B enters the
>>>read, does thread B see an f_pos which starts out at the beginning of A's
>>>read, or the end of it?
>>>
>>>
>>>Similar questions apply as the threads exit their read()s.
>>>
>>>
>>>Either way, there's no way in which we should serialise concurrent readers.
>>>That would really suck for sensible apps which are using pread64().
>>>
>>>
>>Surely, we can just serialise read() (and related) calls that modify f_pos?
>>Since pread() doesn't modify f_pos we shouldn't need to serialise those calls
>>no? Also doesn't spec make the same claims about other calls that modify
>>f_pos such as write()?
>>
>>
>
>We could do somethnig like that.
>
>But is there any application in which two threads simultaneously perform
>read() against the same fd which is not already buggy?
>
>
>
>
touché :) but still we should do what we can.. want me to make a patch?
Matt
next prev parent reply other threads:[~2004-02-06 9:26 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-02-06 9:09 VFS locking: f_pos thread-safe ? Matt
2004-02-06 9:16 ` Andrew Morton
2004-02-06 9:26 ` Matt [this message]
2004-02-06 9:35 ` Andrew Morton
2004-02-06 10:19 ` Matthias Urlichs
2004-02-06 11:18 ` viro
2004-02-06 18:59 ` Matthias Urlichs
2004-02-06 19:54 ` Werner Almesberger
2004-02-08 15:58 ` Kai Henningsen
2004-02-19 15:14 ` Pavel Machek
[not found] ` <20040206101941.4cd9c882.shemminger@osdl.org>
2004-02-06 18:47 ` Matthias Urlichs
2004-02-06 13:50 ` Werner Almesberger
2004-02-06 13:56 ` viro
2004-02-06 14:24 ` Werner Almesberger
-- strict thread matches above, loose matches on Subject: below --
2004-02-06 7:12 Werner Almesberger
2004-02-06 7:55 ` Andrew Morton
2004-02-06 18:37 ` Joel Becker
2004-02-06 19:05 ` Matthias Urlichs
2004-02-07 1:35 ` Joel Becker
2004-02-06 20:09 ` Werner Almesberger
2004-02-06 20:56 ` Valdis.Kletnieks
2004-02-07 0:55 ` Werner Almesberger
2004-02-06 20:54 ` Andries Brouwer
2004-02-07 23:45 ` Werner Almesberger
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=40235DCC.2060606@ntlworld.com \
--to=dirtbird@ntlworld.com \
--cc=akpm@osdl.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox