[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:28:14 UTC 2018


I also note that the "forever" is in fact writing to a TVar. I'd be curious
as to whether it's retrying for some reason, possibly related to the "lost"
TVars confusing the STM machinery. I seem to recall it has some
infelicities currently; and I have no idea how (or if) STM retries interact
with thread yielding.

On Thu, Nov 29, 2018 at 2:25 PM Bryan Richter <b at chreekat.net> wrote:

>
>
> On Thu, Nov 29, 2018, 20:51 Johannes Waldmann <
> johannes.waldmann at htwk-leipzig.de wrote:
>
>> On 11/29/18 7:48 PM, Brandon Allbery wrote:
>>
>> > main thread exiting will kill the entire process,
>>
>> The main thread does "forever $ something".
>>
>> The process does not exit (I am not getting
>> the console prompt). I observe that the process
>> either prints and then hangs, or it hangs immediately.
>>
>
> Printing to the console still isn't a great test to see if something has
> "run", because of buffering that seems to behave unintuitively in these
> situations. Maybe try flushing stdout within the forked thread, to ensure
> the runtime is doing what you think it's doing?
> _______________________________________________
> 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/871bb702/attachment.html>


More information about the Haskell-Cafe mailing list