Improved TimerManager API

19 views
Skip to first unread message

Mitchell Rosen

unread,
May 12, 2020, 7:59:34 PM5/12/20
to core-librari...@haskell.org, libr...@haskell.org
Hi all,

I'd like to propose we modify GHC.Event.updateTimeout and GHC.Event.unregisterTimeout to each return a Bool, indicating whether the update/unregister was successful.

Thanks,
Mitchell 

George Wilson

unread,
May 31, 2020, 1:38:37 AM5/31/20
to Mitchell Rosen, core-librari...@haskell.org, Haskell Libraries
Admittedly I'm not familiar with that module, but this change seems
easy to make.
It seems as though these functions don't exactly "fail"; rather they
don't bother updating the queue if the change would be redundant. Is
that correct? Could you explain why you want to detect this?

Cheers,
George
> --
> You received this message because you are subscribed to the Google Groups "haskell-core-libraries" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to haskell-core-libr...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/haskell-core-libraries/CAKYGvgMMPdWUhjT_C%3DrDAkjhEkAZXxL4q0yLzZp2-F%2BbbqQmyQ%40mail.gmail.com.

chessai .

unread,
May 31, 2020, 1:09:47 PM5/31/20
to George Wilson, Mitchell Rosen, core-librari...@haskell.org, Haskell Libraries
Andrew has done a lot of work with the Event Manager. Perhaps he has a more nuanced opinion on this, but I don't see any reason why not. So I am +1.

Out of curiosity, what are you doing with the event manager?

Kazu Yamamoto

unread,
Jun 2, 2020, 10:56:41 AM6/2/20
to mitchel...@gmail.com, libr...@haskell.org, core-librari...@haskell.org
Hello,

If I remember correctly, the current algorithm of TimerManager was
proposed by me. That is, TimerManager is waken up only when the
internal PSQ is changed. (See abda03be6794ffd9bbc2c4f77d7f9d534a202b21)

I would like to understand what failure (or success) means. Does it
include BOTH TimerManager is not waken up AND poll() system call
returns -1?

I guess that this change is a little bit harder than people expect.

--Kazu
>> https://groups.google.com/d/msgid/haskell-core-libraries/CABzzMazjVQBz5C6wEDOr3-fnXfZq_A_JAAvXUQ4nw0XYADs4FQ%40mail.gmail.com
>> .
>>
Reply all
Reply to author
Forward
0 new messages