Einar Karttunen writes:

 > What is the best way of doing an computation with a timeout?

At <http://cryp.to/child/> you'll find a very readable and
straightforward implementation of a generic timeout
function:

  type Timeout = Int
  timeout :: Timeout -> IO a -> IO (Maybe a)

The function uses the "two threads" approach you've
outlined, and it has proven to work nicely in practice.

Peter

_______________________________________________
Haskell-Cafe mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to