<div dir="ltr">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.</div><br><div class="gmail_quote"><div dir="ltr">On Thu, Nov 29, 2018 at 2:49 PM Johannes Waldmann <<a href="mailto:johannes.waldmann@htwk-leipzig.de">johannes.waldmann@htwk-leipzig.de</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">> so thread scheduling would be more obvious with individual<br>
> characters being output instead of a single flush triggered by the final<br>
> putChar.<br>
<br>
Yes but in my example program, there is no contention for stdout,<br>
as only one thread is using it.<br>
<br>
I am inclined to enter this into the GHC issue tracker<br>
as it seems there's no obvious explanation,<br>
and "lost TVars confusing the STM machinery" was mentioned.<br>
Do you mean that this a known thing? Searching the tracker<br>
for "lost TVar" does not turn up anything.<br>
<br>
- J.W.<br>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div>brandon s allbery kf8nh</div><div><a href="mailto:allbery.b@gmail.com" target="_blank">allbery.b@gmail.com</a></div></div></div></div></div>