std::cin, std::cerr, std::clog behaviour

Gary Hughes geh@itga.com.au
Fri Oct 24 05:10:00 GMT 2003


No I wasn't calling std::ios::sync_with_stdio(false), I am now though, fixed
the problem.

Thanks.

Gary.

> -----Original Message-----
> From: libstdc++-owner@gcc.gnu.org 
> [mailto:libstdc++-owner@gcc.gnu.org] On Behalf Of Nathan Myers
> Sent: Friday, 24 October 2003 3:04 PM
> To: libstdc++@gcc.gnu.org
> Subject: Re: std::cin, std::cerr, std::clog behaviour
> 
> 
> On Fri, Oct 24, 2003 at 10:12:08AM +1000, Gary Hughes wrote:
> > I have recently upgraded from gcc 2.9.3 to gcc 3.3 and have 
> noticed a
> > difference in the behaviour of these streams I was not expecting.
> > 
> > Under 2.95.3 writing a string such as "blah blah" to any of 
> these streams
> > would result in a single call to write(). Under 3.3 this 
> behaviour is the
> > same for std::cout, but std::cerr and std::clog call 
> write() for each
> > character in the string.
> 
> Does your program call std::ios::sync_with_stdio(false) before
> performing any I/O?
> 
> In any case, most of the effort that has gone into optimizing I/O in 
> libstdc++ will bear fruit in the gcc-3.4 release.  Earlier 
> 3.x releases 
> have had (decreasingly) embarassing performance.  
> 
> Nathan Myers
> ncm@cantrip.org
> 



More information about the Libstdc++ mailing list