Well ... - apparently nothing! If i try
Prelude Control.Concurrent.Async Data.List> do {_ <- async $ return $! foldl '(+) 0 [0,0.1 .. 1e + 8 :: Double]; print "Async is lost!" }
"Async is lost!"
one processor core starts to work for some time, the interface remains normal. Obviously, the thread starts and just starts until something needs to be done.
But (efficiency aside), that is, in principle, normal, or should Async always be either cancel led or wait ed for? Is something breaking because there is simply no way to read the result? And does the GC cleanse properly? Perhaps the thread will really stop, and it just wonβt happen when I try (due to lack of memory pressure)? Does the thread really even βendβ at all, simply when the forkIO ed action forkIO ?
I am not at all sure about this concurrency stuff. Maybe I'm still thinking too much about it in C ++. RAII / deterministic garbage collection certainly makes you feel a little better in such ways ...
source share