[Haskell-cafe] semantics of concurrent program depends on -O level, -f[no-]omit-yields

Brandon Allbery allbery.b at gmail.com
Thu Nov 29 19:40:07 UTC 2018

The idea is that putStrLn iterates putChar over the String, then putChar
'\n'; so thread scheduling would be more obvious with individual characters
being output instead of a single flush triggered by the final putChar.

On Thu, Nov 29, 2018 at 2:37 PM Johannes Waldmann <
johannes.waldmann at htwk-leipzig.de> wrote:

> > ... try flushing stdout within the forked thread,
> I did. The behaviour is still as described:
> depends on -O0/2, [no]omit-yield,
> and small changes in the source.
> While I agree with the general point -
> why would I need to hFlush after putStrLn?
> hGetBuffering stdout  tells me it's  LineBuffering,
> and putStrLn does write a line?
> - J.
> _______________________________________________
> Haskell-Cafe mailing list
> To (un)subscribe, modify options or view archives go to:
> http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
> Only members subscribed via the mailman list are allowed to post.

brandon s allbery kf8nh
allbery.b at gmail.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/haskell-cafe/attachments/20181129/dd73ab82/attachment.html>

More information about the Haskell-Cafe mailing list