From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@sympa.inria.fr Delivered-To: caml-list@sympa.inria.fr Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by sympa.inria.fr (Postfix) with ESMTPS id 1802D7F8F2 for ; Tue, 3 Jun 2014 17:39:13 +0200 (CEST) Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of interlock.public@gmail.com) identity=pra; client-ip=209.85.128.176; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="interlock.public@gmail.com"; x-sender="interlock.public@gmail.com"; x-conformance=sidf_compatible Received-SPF: Pass (mail2-smtp-roc.national.inria.fr: domain of interlock.public@gmail.com designates 209.85.128.176 as permitted sender) identity=mailfrom; client-ip=209.85.128.176; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="interlock.public@gmail.com"; x-sender="interlock.public@gmail.com"; x-conformance=sidf_compatible; x-record-type="v=spf1" Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of postmaster@mail-ve0-f176.google.com) identity=helo; client-ip=209.85.128.176; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="interlock.public@gmail.com"; x-sender="postmaster@mail-ve0-f176.google.com"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AsUFAGrrjVPRVYCwlGdsb2JhbABZhDGCbKdQAQaYFgSBBwgWDgEBAQEHCwsJEiqCPhEdARseAxIJBzcCJAERAQUBV4gLAQMRnWWDEWqLJ4Fygw2ZdQoZJw1khF4RAQUMhUmJGoIeDzISgTkElgKECJFCGCmEaTw X-IPAS-Result: AsUFAGrrjVPRVYCwlGdsb2JhbABZhDGCbKdQAQaYFgSBBwgWDgEBAQEHCwsJEiqCPhEdARseAxIJBzcCJAERAQUBV4gLAQMRnWWDEWqLJ4Fygw2ZdQoZJw1khF4RAQUMhUmJGoIeDzISgTkElgKECJFCGCmEaTw X-IronPort-AV: E=Sophos;i="4.98,966,1392159600"; d="scan'208";a="77849080" Received: from mail-ve0-f176.google.com ([209.85.128.176]) by mail2-smtp-roc.national.inria.fr with ESMTP/TLS/RC4-SHA; 03 Jun 2014 17:39:12 +0200 Received: by mail-ve0-f176.google.com with SMTP id jz11so7108249veb.21 for ; Tue, 03 Jun 2014 08:39:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=/JMbFANMMl7fe+xA1DZJbZcFgj+KIQhZLVCOeUEKhdM=; b=DlrHu9qnlo4YGKJgFr696Ru/SI3CoxguHfzskUnxwgpWCNhHhuhKq3ZyOzyiDQnjKk Xcrr8u5JXa42oxsnRiDoJM82U90jD354/o/09go2+vQortl4Se1WaMvWa+rGh7g3ttHo CiVPfVqmF3xRSsBNTZOYAw1opJojSecUvkpvbLwQTRr9HTlDDkobSazy0mxam7Xqz8V5 uleM4uLwU2HJ6qUCsUSwzp4k8XJ7sEaROvgfkTEEt+Xwm7OL+6MT2peyTe9tIiG+juon ZRmsr/6hVPrhWOutcSHDrQDqsm0Kz4wIM9XUqCiTQwtsDhScucYG5VuZxVWRHXLJ5nkK zksg== MIME-Version: 1.0 X-Received: by 10.58.83.69 with SMTP id o5mr2634253vey.58.1401809951550; Tue, 03 Jun 2014 08:39:11 -0700 (PDT) Received: by 10.221.45.130 with HTTP; Tue, 3 Jun 2014 08:39:11 -0700 (PDT) Date: Tue, 3 Jun 2014 16:39:11 +0100 Message-ID: From: Dan Stark To: caml-list@inria.fr Content-Type: multipart/alternative; boundary=047d7b5d33483470ca04faf0506b Subject: [Caml-list] How is Async implemented? --047d7b5d33483470ca04faf0506b Content-Type: text/plain; charset=UTF-8 Hi all I am trying to get a rough overview of how Async is implemented (or the idea behind it) before I really dig into its source code. I have the following questions: *Q1:* Is Async event-loop like? >From the API and some docs for Async's usage, I feel it is quite like a event-loop. You create Deferred.t and it might be added to a queue and a scheduler behind might be adjusting the order of running for all Deferred.t in the queue. Am I correct? *Q2:* Deferred.return and Deferred.bind If I say Deferred.return 1 It will returns me a Deferred.t, but inside the function *return* or *bind* somehow an "event" is implicitly added to the default queue for scheduling, right? If I am correct above, *Q3:* Is Async depending on -thread? The queue or scheduler needs compiler support? I just need to understand the whole picture in a rough way first. Thanks Dan --047d7b5d33483470ca04faf0506b Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Hi all

I am trying to get a rough overv= iew of how Async is implemented (or the idea behind it) before I really dig= into its source code.

I have the following questi= ons:

Q1:=C2=A0Is Async event-loop like?
From the API and some docs for Async's usage, I feel it is = quite like a event-loop.=C2=A0

You create Deferred= .t and it might be added to a queue and a scheduler behind might be adjusti= ng the order of running for all Deferred.t in the queue.=C2=A0

Am I correct?

Q2: Defer= red.return and Deferred.bind

If I say
Deferred.return 1

It will returns me a Defe= rred.t, but inside the function return=C2=A0or bind somehow a= n "event" is implicitly added to the default queue for scheduling= , right?

If I am correct above,=C2=A0

<= b>Q3:=C2=A0Is Async depending on -thread? The queue or scheduler needs = compiler support?=C2=A0

I just need to understand = the whole picture in a rough way first.

Thanks

Dan












--047d7b5d33483470ca04faf0506b--