[Haskell-cafe] Faster timeout but is it correct?

Johan Tibell johan.tibell at gmail.com
Tue Feb 22 04:10:22 CET 2011


On Mon, Feb 21, 2011 at 3:16 PM, Bas van Dijk <v.dijk.bas at gmail.com> wrote:
> On 21 February 2011 21:55, Johan Tibell <johan.tibell at gmail.com> wrote:
>> ...include TimeoutKey in the TimeoutCallback type.
>
> Done: http://hackage.haskell.org/trac/ghc/attachment/ticket/4963/faster_timeout.dpatch

Could we store a full TimeoutCallback in the PSQ? At the line that reads

      sequence_ $ map Q.value expired

you'll need to pass the PSQ key (which is the Unique) to the callback.
Most callbacks will ignore this key but by doing this we 1) decrease
the size of the closure we store in the PSQ and 2) make the mechanism
more flexible for future use.

(There's a small chance that I've read the diff wrong. I haven't
applied the patch and look at it in a real diff viewer).

Johan



More information about the Haskell-Cafe mailing list