[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:53:36 UTC 2018

What does this have to do with contention for stdout? Thread switching is
unrelated; seeing individual output operations just gives more hints about
when the thread switches happen. And with -fno-omit-yields it presumably
can happen when putChar is evaluated, not because of I/O but because of
function entry.

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

> > so thread scheduling would be more obvious with individual
> > characters being output instead of a single flush triggered by the final
> > putChar.
> Yes but in my example program, there is no contention for stdout,
> as only one thread is using it.
> I am inclined to enter this into the GHC issue tracker
> as it seems there's no obvious explanation,
> and "lost TVars confusing the STM machinery" was mentioned.
> Do you mean that this a known thing? Searching the tracker
> for "lost TVar" does not turn up anything.
> - J.W.

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/722d5abd/attachment-0001.html>

More information about the Haskell-Cafe mailing list