
7 Jan
2005
7 Jan
'05
11:10 a.m.
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