[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: [Help-glpk] Feature request - option to flush output
From: |
Hart, William E |
Subject: |
RE: [Help-glpk] Feature request - option to flush output |
Date: |
Mon, 14 Sep 2009 22:30:09 +0400 |
These are not quite the same. Using setvbuf() forces flushing for every
character, while explicit use of fflush() only flushes after end-of-line
characters (as implimented in glpk). I perfer glpk's current implementation.
--Bill
> -----Original Message-----
> From: Tor Myklebust [mailto:address@hidden
> Sent: Monday, September 14, 2009 12:19 PM
> To: Andrew Makhorin
> Cc: Hart, William E; address@hidden
> Subject: Re: [Help-glpk] Feature request - option to flush output
>
> On Mon, 14 Sep 2009, Andrew Makhorin wrote:
>
> >> By default, IO streams are not regularly flushed; they are
> buffered
> >> in the computer until 'enough' IO has been done (or until
> the stream
> >> is closed).
> >
> >> I'm piping glpsol through some Python code and this buffering is
> >> creating a noticable delay in my processing. What I'd like is an
> >> option that enables explicit flushing of glpsol's output. For
> >> example, after each status line is printed, you might execute:
> >
> >> flush(stdout)
> >
> >> (or do "cout << flush" in C++).
> >
> > Exactly this feature was added in glpk 4.35:
> >
> > The statement "if (c = '\n') fflush(stdout)" was added to the
> > internal routine xputc to provide "real-time" terminal output.
>
> = versus == aside, isn't this the wrong way to do it? You
> can already configure the buffering behaviour of a FILE*
> using setvbuf(); just say "setvbuf(stdout, (char*)0, _IOLBF, 0);".
>
>
RE: [Help-glpk] Feature request - option to flush output, Hart, William E, 2009/09/14
RE: [Help-glpk] Feature request - option to flush output, Hart, William E, 2009/09/14
RE: [Help-glpk] Feature request - option to flush output,
Hart, William E <=