Complete.Org: Mailing Lists: Archives: freeciv-dev: May 2000:
[Freeciv-Dev] Re: setvbuf on stdout instead of using fflush
Home

[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]
To: gohmandj@xxxxxxxxxxx
Cc: freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] Re: setvbuf on stdout instead of using fflush
From: David Pfitzner <dwp@xxxxxxxxxxxxxx>
Date: Mon, 15 May 2000 13:42:38 +1000 (EST)

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



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