From: Jeremie Dimino <jdimino@janestreet.com>
To: Ivan Gotovchits <ivg@ieee.org>
Cc: "caml-list@inria.fr" <caml-list@inria.fr>
Subject: Re: [Caml-list] lwt exceptions and infinite loops
Date: Tue, 19 Nov 2013 09:21:48 +0000 [thread overview]
Message-ID: <CANhEzE6BAOfkEtVhWuJE9GZFXL4+KHRZ5LKo=AAm05QG+QRZAg@mail.gmail.com> (raw)
In-Reply-To: <8738mthu88.fsf@golf.niidar.ru>
[-- Attachment #1: Type: text/plain, Size: 583 bytes --]
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
[-- Attachment #2: Type: text/html, Size: 1033 bytes --]
next prev parent reply other threads:[~2013-11-19 9:21 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-11-19 4:48 Ivan Gotovchits
2013-11-19 9:21 ` Jeremie Dimino [this message]
2013-11-19 12:32 ` Ivan Gotovchits
2013-11-19 11:06 ` Jacques-Pascal Deplaix
2013-11-19 11:11 ` Raphaël Proust
2013-11-19 11:35 ` Jacques-Pascal Deplaix
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CANhEzE6BAOfkEtVhWuJE9GZFXL4+KHRZ5LKo=AAm05QG+QRZAg@mail.gmail.com' \
--to=jdimino@janestreet.com \
--cc=caml-list@inria.fr \
--cc=ivg@ieee.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).