Hi,

There is no real equivalent of Haskell's killthread in lwt or async. The closest in lwt is Lwt.cancel: if a thread is blocked on a cancelable operation, this one will fail with Lwt.Canceled. Cancelable operations include: sockets and pipes IO, sleeping, waiting on an mvar, etc...

In async the way to do it is to pass an "interrupt" deferred (basically just a [unit Deferred.t] value) down to low-level fd operations. When this deferred becomes determined the operation in progress will be interrupted.

Hope that helps,
Jeremie


On Thu, Oct 17, 2013 at 7:34 PM, Nicolas Ojeda Bar <N.Ojeda.Bar@dpmms.cam.ac.uk> wrote:
Hi,

Is there a way to raise an exception in a different thread than the
currently executing one with lwt? What about J. Street's async?

I am essentially looking for a replacement of Haskell's 'killthread'.

Thank you very much,
Nicolas

--
Caml-list mailing list.  Subscription management and archives:
https://sympa.inria.fr/sympa/arc/caml-list
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
Bug reports: http://caml.inria.fr/bin/caml-bugs



--
Jeremie