One-shot semantics in GHC event manager

Ben Gamari bgamari.foss at gmail.com
Sat Oct 11 21:39:44 UTC 2014


Andreas Voellmy <andreas.voellmy at gmail.com> writes:

> On Sat, Oct 11, 2014 at 12:17 PM, Ben Gamari <bgamari.foss at gmail.com> wrote:
>
> 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.
>
Right.

>> > However, the GHC.Event.Manager module does export its loop function, so if
>> > you create your own non-ONE_SHOT event manager, you can just invoke its
>> > loop function.
>> >
>> Right, but `GHC.Event.Manager` is not exported by `base`.
>>
>
> 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.
>
I have a first cut of this here [1]. It compiles but would be I shocked
if it ran. All of the pieces are there but I need to change
EventLifetime to a more efficient encoding (there's no reason why it
needs to be more than an Int).

Sadly I have to run for the night and will be on a bike ride
tomorrow but perhaps I can come back to it on Monday.

Feel free to read it over and see if I missed something.

Cheers,

- Ben


[1] https://github.com/bgamari/packages-base/compare/ghc:ghc-7.8...event-rework
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 472 bytes
Desc: not available
URL: <http://www.haskell.org/pipermail/ghc-devs/attachments/20141011/cce120b4/attachment.sig>


More information about the ghc-devs mailing list