On Tue, Nov 19, 2013 at 4:48 AM, Ivan Gotovchits <ivg@ieee.org> wrote:
consider the following simple example:

  open Lwt
  let rec loop () = Lwt_unix.sleep 1. >> loop ()
  let bad () = Lwt_unix.sleep 1. >> fail Not_found
  let () = Lwt_main.run (join [loop (); bad ()])


This program never terminates with an exception as I expect.

Can someone clarify to me what really happens underneath the hood?

Lwt.join waits for all thread to terminate (with a value or an exception). In this case [loop ()] is still running so the join doesn't terminate.

-- 
Jeremie