One-shot semantics in GHC event manager

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

Andreas Voellmy <andreas.voellmy at> writes:

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

>> > 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.


- Ben

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 472 bytes
Desc: not available
URL: <>

More information about the ghc-devs mailing list