[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: `message' not outputting the newline "atomically"

From: Eli Zaretskii
Subject: Re: `message' not outputting the newline "atomically"
Date: Sun, 23 Jun 2019 05:25:48 +0300

> Cc: address@hidden, address@hidden, address@hidden
> From: Paul Eggert <address@hidden>
> Date: Sat, 22 Jun 2019 12:14:55 -0700
>    static void
>    dump_fingerprint (const char *label, unsigned char const *xfingerprint)
>    {
>      fprintf (stderr, "%s: ", label);
>      for (int i = 0; i < 32; ++i)
>        fprintf (stderr, "%02x", (unsigned) xfingerprint[i]);
>      fprintf (stderr, "\n");
>    }
> Here, GNU/Linux Emacs would issue 34 'write' system calls if stderr were 
> using 
> _IONBF (and the output line could be interleaved with other output lines, 
> possibly causing confusion), whereas GNU/Linux Emacs issues just one 'write' 
> system call now that stderr uses _IOLBF (thus avoiding the confusion).
> I don't see any significant problem with line-buffering here, or anywhere 
> else 
> that Emacs outputs to stderr. And I've looked at quite a few uses.

What if Emacs crashes half way through that loop, because 'i' is
computed incorrectly?  With line buffering, we risk not seeing

OTOH, the number of system calls is not something we should be
bothered with.

So this looks like a net loss to me.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]