<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<p>I'm pretty sure you can't cancel goroutine. Actually I have <br>
</p>
<p>very bad experience with thread cancelation. Therefore flags</p>
<p>passed via channels/mvars or shared flags are used to stop</p>
<p>threads. <br>
</p>
<p>Greets,<br>
Branimir.<br>
</p>
<div class="moz-cite-prefix">On 3/18/20 10:10 AM, YueCompl wrote:<br>
</div>
<blockquote type="cite"
cite="mid:3B0EBA42-ECA4-482A-9675-3166CFB54454@icloud.com">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
Idiomatic resource leakage prevention in short.
<div class=""><br class="">
<div class="">An app wants to be as responsive to its users as
practically feasible, it would try multiple paths to
load-balanced resources, and use the first response that come
back, then cancel other paths. Cancellation can help reducing
vain computation in such architectures, sometimes largely
enough.<br class="">
<div><br class="">
<blockquote type="cite" class="">
<div class="">On 2020-03-18, at 16:58, Branimir Maksimovic
<<a href="mailto:branimir.maksimovic@gmail.com"
class="" moz-do-not-send="true">branimir.maksimovic@gmail.com</a>>
wrote:</div>
<br class="Apple-interchange-newline">
<div class="">
<meta http-equiv="Content-Type" content="text/html;
charset=UTF-8" class="">
<div class="">
<p class="">What's wrong with forkIO?</p>
<p class="">Greets,<br class="">
Branimir.<br class="">
</p>
<div class="moz-cite-prefix">On 3/18/20 9:37 AM,
YueCompl via Haskell-Cafe wrote:<br class="">
</div>
<blockquote type="cite"
cite="mid:B35ABE4A-57B5-4834-9DCE-EBFF5531A07F@icloud.com"
class="">
<meta http-equiv="Content-Type" content="text/html;
charset=UTF-8" class="">
If not for tight loops or other CPU intensive tasks,
you may be interested in Edh, which introduces Go's
goroutine to GHC runtime. But Edh threads add much
higher overhead on top of GHC threads, so there's a
price to pay for simplicity of end programmer's job.
<div class=""><br class="">
</div>
<div class="">It's briefly described at <a
href="https://github.com/e-wrks/edh/tree/master/Tour#program--threading-model"
class="" moz-do-not-send="true">https://github.com/e-wrks/edh/tree/master/Tour#program--threading-model</a> .
This is very new and I'm right now actively
working on it for PoC of an STM powered in-memory
graph database implementation.</div>
<div class=""><br class="">
</div>
<div class="">Best regards,</div>
<div class="">Compl<br class="">
<div class=""><br class="">
<blockquote type="cite" class="">
<div class="">On 2020-03-18, at 11:15, Niklas
Hambüchen <<a href="mailto:mail@nh2.me"
class="" moz-do-not-send="true">mail@nh2.me</a>>
wrote:</div>
<br class="Apple-interchange-newline">
<div class="">
<div class="">I've you're new to async, also
check out my recent rework of the docs
that talk about this topic specifically:<br
class="">
<br class="">
<a
href="https://github.com/simonmar/async/pull/105/files"
class="" moz-do-not-send="true">https://github.com/simonmar/async/pull/105/files</a><br
class="">
<br class="">
(To be available in the next release of
async.)<br class="">
_______________________________________________<br class="">
Haskell-Cafe mailing list<br class="">
To (un)subscribe, modify options or view
archives go to:<br class="">
<a class="moz-txt-link-freetext"
href="http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe"
moz-do-not-send="true">http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe</a><br
class="">
Only members subscribed via the mailman
list are allowed to post.</div>
</div>
</blockquote>
</div>
<br class="">
</div>
<br class="">
<fieldset class="mimeAttachmentHeader"></fieldset>
<pre class="moz-quote-pre" wrap="">_______________________________________________
Haskell-Cafe mailing list
To (un)subscribe, modify options or view archives go to:
<a class="moz-txt-link-freetext" href="http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe" moz-do-not-send="true">http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe</a>
Only members subscribed via the mailman list are allowed to post.</pre>
</blockquote>
</div>
_______________________________________________<br
class="">
Haskell-Cafe mailing list<br class="">
To (un)subscribe, modify options or view archives go to:<br
class="">
<a
href="http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe"
class="" moz-do-not-send="true">http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe</a><br
class="">
Only members subscribed via the mailman list are allowed
to post.</div>
</blockquote>
</div>
<br class="">
</div>
</div>
</blockquote>
</body>
</html>