From: "H. Peter Anvin" <hpa@zytor.com>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Junio C Hamano <junkio@cox.net>, git@vger.kernel.org
Subject: Re: [RFH] plumber's puzzle
Date: Mon, 23 Apr 2007 17:51:19 -0700 [thread overview]
Message-ID: <462D5487.2000601@zytor.com> (raw)
In-Reply-To: <alpine.LFD.0.98.0704221546160.9964@woody.linux-foundation.org>
Linus Torvalds wrote:
>
> On Sun, 22 Apr 2007, Junio C Hamano wrote:
>> I should be happy that I figured out what is going on, but I am
>> not very happy with this patch.
>
> That actually looks like the right patch.
>
> The "fflush() before fork()" thing is a real issue, and a real bug. Stdio
> is buffered, and yes, fork() will duplicate the buffer if not flushed.
>
> Of course, I'm not 100% sure that is the right _place_ for the fflush()
> call. I wonder if we should just do the fflush() closer to the place that
> generates the data. As it is, we may have other things like that lurking.
>
> Of course, delaying the fflush as long as possible is likely good for
> performance, so doing it just before the fork() (even if it may be ugly
> and somewhat unexpected at that point to have to do it) may just be the
> right thing regardless...
>
It might be worthwhile to have a wrapper function for fork() which adds
fflush(NULL); before forking?
-hpa
next prev parent reply other threads:[~2007-04-24 0:52 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-04-22 19:53 [RFH] plumber's puzzle Junio C Hamano
2007-04-22 20:30 ` Florian Weimer
2007-04-22 20:43 ` Linus Torvalds
2007-04-22 22:34 ` Junio C Hamano
2007-04-22 23:03 ` Linus Torvalds
2007-04-22 23:52 ` Junio C Hamano
2007-04-24 0:51 ` H. Peter Anvin [this message]
2007-04-24 8:36 ` Johannes Schindelin
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=462D5487.2000601@zytor.com \
--to=hpa@zytor.com \
--cc=git@vger.kernel.org \
--cc=junkio@cox.net \
--cc=torvalds@linux-foundation.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.