Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
From: "Jérémie Dimino" <jeremie@dimino.org>
To: Yaron Minsky <yminsky@gmail.com>
Cc: rixed@happyleptic.org, caml-list@inria.fr
Subject: Re: [Caml-list] [ANN] Async, a monadic concurrency library
Date: Wed, 26 Oct 2011 14:49:40 +0200	[thread overview]
Message-ID: <20111026124940.GA27492@solaria.dimino.org> (raw)
In-Reply-To: <CADKNfhJi_AtxgaOYiVrAemY33rpbChR-Jk9OXF2nZdC4KHZsJg@mail.gmail.com>

On Wed, Oct 26, 2011 at 07:34:45AM -0400, Yaron Minsky wrote:
> It's an excellent question, and one I don't yet have a good feel for.  It
> would be great to find some kind of modus vivendi which would allow the
> libraries to interoperate.

I think it is not too hard to mix Lwt.t and Defered.t values, one can
start with something like that:

  let lwt_of_async t =
    let waiter, wakener = Lwt.wait () in
    Defered.upon t (Lwt.wakeup wakener);
    waiter

  let async_of_lwt t =
    Defered.create (fun ivar -> Lwt.on_success t (Ivar.fill ivar))

But we need to check how this behaves with error handling, and also the
local storage of Lwt.

For the scheduler the easiest solution is probalby to write a Lwt engine
based on Async.

-- 
Jérémie

  reply	other threads:[~2011-10-26 12:49 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-26  0:32 Yaron Minsky
2011-10-26  5:31 ` Cedric Cellier
2011-10-26 10:40   ` Yaron Minsky
2011-10-26  7:33 ` Gerd Stolpmann
2011-10-26 10:57   ` Yaron Minsky
2011-10-26 11:18     ` rixed
2011-10-26 11:34       ` Yaron Minsky
2011-10-26 12:49         ` Jérémie Dimino [this message]
2011-10-26 12:31     ` Gerd Stolpmann
2011-10-27 17:36       ` Milan Stanojević
2011-10-27 18:34         ` Gerd Stolpmann
2011-10-27 19:10           ` Milan Stanojević
2011-10-28  7:29             ` Gerd Stolpmann
2011-10-26  8:07 ` Jérémie Dimino
2011-10-26 11:03   ` Yaron Minsky
2011-10-26 11:06     ` Mark Shinwell
2011-10-26 11:20       ` Anil Madhavapeddy
2011-10-26 11:37         ` Mark Shinwell
2011-10-29  0:52       ` oliver
2011-10-31  9:12         ` Mark Shinwell

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=20111026124940.GA27492@solaria.dimino.org \
    --to=jeremie@dimino.org \
    --cc=caml-list@inria.fr \
    --cc=rixed@happyleptic.org \
    --cc=yminsky@gmail.com \
    /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