On 11/8/06, Simon Marlow <simonmarhaskell@gmail.com> wrote:
Nearly - but this one doesn't nest. Also, it's possible for the Timeout exception to leak.
Okay, nesting could be covered by changing Timeout to Timeout Unique (or something else equivalent). The exception leaking is impossible to avoid so long as the application can catch arbitrary exceptions. You can't have E get the same number for myThreadId without running it in the main thread. You can't have E run in the main thread without having to interrupt it with something. The only something that is currently available is an exception. Any exception could leak because we allow generic catch. So there is no "perfect" timeout without an RTS change. -- Taral <taralx@gmail.com> "You can't prove anything." -- Gödel's Incompetence Theorem