mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: viro@parcelfarce.linux.theplanet.co.uk
To: Matthias Urlichs <smurf@smurf.noris.de>
Cc: linux-kernel@vger.kernel.org
Subject: Re: VFS locking: f_pos thread-safe ?
Date: Fri, 6 Feb 2004 11:18:53 +0000	[thread overview]
Message-ID: <20040206111853.GE21151@parcelfarce.linux.theplanet.co.uk> (raw)
In-Reply-To: <pan.2004.02.06.10.19.57.885433@smurf.noris.de>

On Fri, Feb 06, 2004 at 11:19:58AM +0100, Matthias Urlichs wrote:
> I've written one of those... a migration program from an old
> fixed-record-size database to SQL. Somebody had the brilliant idea to let
> two threads read the file concurrently, postprocess the thing (which took
> a variable amount of time depending on what was in the record) and then
> feed it to the database (ditto).

"Somebody made a guess about undefined behaviour"

> When that idea didn't work, I used a separate reader thread and
> coordinated buffer usage with semaphores or whatever, making the thing a
> whole lot more complicated in the process. :-/

"Guess what? It didn't work".
 
> So count me as one of those people who think that it does matter -- if N
> threads read a file of M bytes, they should collectively get M bytes from
> it (possibly out of order, of course, but that's a different problem).
> Anything else would be inconsistent.

"Please, make that undefined behaviour conform to the guess made by that
somebody.  Whaddya mean, 'non-portable' and 'broken application'?!?!?".

> Same thing goes for writing (in append mode as well as otherwise).

Look for ->i_sem use in there.

  reply	other threads:[~2004-02-06 11:18 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-02-06  9:09 Matt
2004-02-06  9:16 ` Andrew Morton
2004-02-06  9:26   ` Matt
2004-02-06  9:35     ` Andrew Morton
2004-02-06 10:19       ` Matthias Urlichs
2004-02-06 11:18         ` viro [this message]
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=20040206111853.GE21151@parcelfarce.linux.theplanet.co.uk \
    --to=viro@parcelfarce.linux.theplanet.co.uk \
    --cc=linux-kernel@vger.kernel.org \
    --cc=smurf@smurf.noris.de \
    /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

all inboxes | Powered by JetHome®