[Freeciv-Dev] Re: setvbuf on stdout instead of using fflush
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
Dan Gohman <gohmandj@xxxxxxxxxxx> wrote:
> I was looking through server/console.c and noticed that we're calling
> fflush(stdout) after every output. We could accomplish the same thing by
> turning off the buffering on stdout with setvbuf().
Yeah, we could, but is there a good reason why we should?
I guess I'd like some more justification on why/whether
this is a better approach...
Eg, current code does not flush after _every_ line of output:
mainly only when printing new prompt (eg, may occur after multiple
lines of output). It _may_ be that no buffering is preferable,
eg to make sure server gets timely output during long AI calcs etc,
but OTOH current method does allow more potential control in when
and where we call con_flush().
-- David
|
|