From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail1-relais-roc.national.inria.fr (mail1-relais-roc.national.inria.fr [192.134.164.82]) by walapai.inria.fr (8.13.6/8.13.6) with ESMTP id p9QCnlp0020878 for ; Wed, 26 Oct 2011 14:49:47 +0200 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Ak4JAAkBqE7VuiYS/2dsb2JhbABCqCmBEIEFgW4BAQUMGwsBRhALDgocEhQYMS6HZ7RviAlhBKVr X-IronPort-AV: E=Sophos;i="4.69,409,1315173600"; d="scan'208";a="126094154" Received: from solaria.dimino.org ([213.186.38.18]) by mail1-smtp-roc.national.inria.fr with ESMTP; 26 Oct 2011 14:49:42 +0200 Received: by solaria.dimino.org (Postfix, from userid 1000) id EE7D68004E; Wed, 26 Oct 2011 14:49:40 +0200 (CEST) Date: Wed, 26 Oct 2011 14:49:40 +0200 From: =?iso-8859-1?Q?J=E9r=E9mie?= Dimino To: Yaron Minsky Cc: rixed@happyleptic.org, caml-list@inria.fr Message-ID: <20111026124940.GA27492@solaria.dimino.org> Mail-Followup-To: Yaron Minsky , rixed@happyleptic.org, caml-list@inria.fr References: <1319614400.18639.148.camel@thinkpad> <20111026111858.GA21504@ccellier.rd.securactive.lan> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.5.20 (2009-06-14) Subject: Re: [Caml-list] [ANN] Async, a monadic concurrency library 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