This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug libstdc++/56016] mutlithreading problem with iostream


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56016

--- Comment #2 from JxP <bugs at justexpired dot e4ward.com> 2013-01-17 17:24:52 UTC ---
Created attachment 29195
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=29195
sample program not mixing iostream with stdio

I confirm that using ios_base::sync_with_stdio(false) makes the original
program run correctly (use argument 3 for that).

However, I would expect that after commenting out all fprintf(stderr) lines,
the program should work correctly even without that extra command (still use
argument 2 for that), because then it doesn't explicitly use any stdio
routines. But it doesn't. To see it fail now that we don't trace steps on
stderr, follow the steps in the original post, use argument 2, then at the end
type jobs to see the first cat still running.

Why would the user be expected to ask iostream not to sync with stdio, if stdio
isn't used?!


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]