From: Junio C Hamano <junkio@cox.net>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: git@vger.kernel.org
Subject: Re: [RFH] plumber's puzzle
Date: Sun, 22 Apr 2007 16:52:51 -0700 [thread overview]
Message-ID: <7vejmcklv0.fsf@assigned-by-dhcp.cox.net> (raw)
In-Reply-To: <alpine.LFD.0.98.0704221546160.9964@woody.linux-foundation.org> (Linus Torvalds's message of "Sun, 22 Apr 2007 16:03:20 -0700 (PDT)")
Linus Torvalds <torvalds@linux-foundation.org> writes:
> 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...
Another possibility I considered is to call low-level _exit so
that we bypass not just stdio flushing but also atexit(). But I
think "fflush() before fork()" is cleaner.
next prev parent reply other threads:[~2007-04-22 23:53 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 [this message]
2007-04-24 0:51 ` H. Peter Anvin
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=7vejmcklv0.fsf@assigned-by-dhcp.cox.net \
--to=junkio@cox.net \
--cc=git@vger.kernel.org \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).