[Haskell-cafe] Help with async library and killing child processes

Branimir Maksimovic branimir.maksimovic at gmail.com
Wed Mar 18 09:16:22 UTC 2020


I'm pretty sure you can't cancel goroutine. Actually I have

very bad experience with thread cancelation. Therefore flags

passed via channels/mvars or shared flags are used to stop

threads.

Greets,
Branimir.

On 3/18/20 10:10 AM, YueCompl wrote:
> Idiomatic resource leakage prevention in short.
>
> 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.
>
>> On 2020-03-18, at 16:58, Branimir Maksimovic 
>> <branimir.maksimovic at gmail.com 
>> <mailto:branimir.maksimovic at gmail.com>> wrote:
>>
>> What's wrong with forkIO?
>>
>> Greets,
>> Branimir.
>>
>> On 3/18/20 9:37 AM, YueCompl via Haskell-Cafe wrote:
>>> 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.
>>>
>>> It's briefly described at 
>>> https://github.com/e-wrks/edh/tree/master/Tour#program--threading-model . 
>>> This is very new and I'm right now actively working on it for PoC of 
>>> an STM powered in-memory graph database implementation.
>>>
>>> Best regards,
>>> Compl
>>>
>>>> On 2020-03-18, at 11:15, Niklas Hambüchen <mail at nh2.me 
>>>> <mailto:mail at nh2.me>> wrote:
>>>>
>>>> I've you're new to async, also check out my recent rework of the 
>>>> docs that talk about this topic specifically:
>>>>
>>>> https://github.com/simonmar/async/pull/105/files
>>>>
>>>> (To be available in the next release of async.)
>>>> _______________________________________________
>>>> 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.
>>>
>>>
>>> _______________________________________________
>>> 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.
>> _______________________________________________
>> 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.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/haskell-cafe/attachments/20200318/9e81ab36/attachment.html>


More information about the Haskell-Cafe mailing list