<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Sat, Oct 11, 2014 at 12:17 PM, Ben Gamari <span dir="ltr"><<a href="mailto:bgamari.foss@gmail.com" target="_blank">bgamari.foss@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">Andreas Voellmy <<a href="mailto:andreas.voellmy@gmail.com">andreas.voellmy@gmail.com</a>> writes:<br>
<br>
> On Sat, Oct 11, 2014 at 1:07 AM, Ben Gamari <<a href="mailto:bgamari.foss@gmail.com">bgamari.foss@gmail.com</a>> wrote:<br>
><br>
>> Thanks for your quick reply!<br>
>><br>
>><br>
</span><span class="">>> What I'm wondering is what the extra complexity bought us. It seems like<br>
>> the same thing could have been achieved with less breakage by making<br>
>> this per-fd instead of per-manager. I may be missing something, however.<br>
>><br>
>><br>
> Generally, ONE_SHOT helped improve performance.<br>
><br>
</span>Sure, I would certainly believe this.<br>
<span class=""><br>
> I agree with you that it may be possible to do this on a per-FD<br>
> basis. I'll look into what it would take to do this.<br>
><br>
</span>I've started playing around with the code to see what might be possible<br>
here. We'll see how far I get.<br>
<span class=""><br>
>> I had considered this but looked for other options for two reasons,<br>
>><br>
>>  * `loop` isn't exported by GHC.Event<br>
>><br>
><br>
> Right - it wouldn't make sense to export the system EventManager's loop.<br>
><br>
</span>The system EventManager's loop is `GHC.Event.Manager.loop`, no?<br></blockquote><div><br></div><div>Yes, but it will be invoked by GHC.Thread and any other callers of it will simply block indefinitely waiting for the thread that is running loop to give it up - which will typically never happen.  </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<span class=""><br>
> However, the GHC.Event.Manager module does export its loop function, so if<br>
> you create your own non-ONE_SHOT event manager, you can just invoke its<br>
> loop function.<br>
><br>
</span>Right, but `GHC.Event.Manager` is not exported by `base`.<br></blockquote><div><br></div><div>Ah... so this is not useful to you. I guess we could add `loop` to GHC.Event's export list. On the other hand, I like your LifeTime proposal better and then no one needs `loop`, so let's try this first.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Cheers,<br>
<br>
- Ben<br>
</blockquote></div><br></div></div>