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 259037FE36 for ; Fri, 1 Jul 2016 03:26:22 +0200 (CEST) IronPort-PHdr: 9a23:lboP5xYvzAA/cUUlos/tLA7/LSx+4OfEezUN459isYplN5qZpcW5bnLW6fgltlLVR4KTs6sC0LuO9fmwEjBdqb+681k6OKRWUBEEjchE1ycBO+WiTXPBEfjxciYhF95DXlI2t1uyMExSBdqsLwaK+i760zceF13FOBZvIaytQ8iJ3pzxjrD5p8CbSj4LrQL1Wal1IhSyoFeZnegtqqwmFJwMzADUqGBDYeVcyDAgD1uSmxHh+pX4p8Y7oGx48sgs/M9YUKj8Y79wDfkBVGxnYFYO+dbzuBLfYQyK73oaGiVKw1sbSzTCuTH3WJvrsyiynO163WHOPcDwQao1Why+6L9sSVnwjyAecTU+9TeEpNZ3ifdqqQimoVRawojPY5DdYOt7f6XGfsIyR2NHU91NTSFMHsW3aI5ZXLlJBvpRs4So/whGlhC5HwT5Qb62xw== Authentication-Results: mail2-smtp-roc.national.inria.fr; spf=None smtp.pra=yminsky@janestreet.com; spf=Pass smtp.mailfrom=yminsky@janestreet.com; spf=None smtp.helo=postmaster@mxout3.mail.janestreet.com Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of yminsky@janestreet.com) identity=pra; client-ip=38.105.200.229; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="yminsky@janestreet.com"; x-sender="yminsky@janestreet.com"; x-conformance=sidf_compatible Received-SPF: Pass (mail2-smtp-roc.national.inria.fr: domain of yminsky@janestreet.com designates 38.105.200.229 as permitted sender) identity=mailfrom; client-ip=38.105.200.229; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="yminsky@janestreet.com"; x-sender="yminsky@janestreet.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@mxout3.mail.janestreet.com) identity=helo; client-ip=38.105.200.229; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="yminsky@janestreet.com"; x-sender="postmaster@mxout3.mail.janestreet.com"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0COAQBcxXVXfeXIaSZbhBR9BqggkygihXUCgS8HPBABAQEBAQEBAREBAQkWCVCCMoIbAQEEEhEdAQEsCwEPCwsNAgIJHQICIhIBBQEKEgYTEgIHB4d0AxcDC6YlgTE+MYpUZ4RDAQEFhyYDhCUBAQEBAQEBAwEBAQEBAQEBFwgQcYUnhE6HQYJahlUMki+GCIg5gjiMco5GEh6BDzWCJxyBaFKJQQEBAQ X-IPAS-Result: A0COAQBcxXVXfeXIaSZbhBR9BqggkygihXUCgS8HPBABAQEBAQEBAREBAQkWCVCCMoIbAQEEEhEdAQEsCwEPCwsNAgIJHQICIhIBBQEKEgYTEgIHB4d0AxcDC6YlgTE+MYpUZ4RDAQEFhyYDhCUBAQEBAQEBAwEBAQEBAQEBFwgQcYUnhE6HQYJahlUMki+GCIg5gjiMco5GEh6BDzWCJxyBaFKJQQEBAQ X-IronPort-AV: E=Sophos;i="5.26,554,1459807200"; d="scan'208";a="224980127" Received: from mxout3.mail.janestreet.com ([38.105.200.229]) by mail2-smtp-roc.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 01 Jul 2016 03:26:21 +0200 Received: from tot-qpr-mailcore1.delacy.com ([172.27.56.68] helo=tot-qpr-mailcore1) by mxout3.mail.janestreet.com with esmtps (TLSv1:DHE-RSA-AES256-SHA:256) (Exim 4.82) (envelope-from ) id 1bInDn-0005Ca-8D for caml-list@inria.fr; Thu, 30 Jun 2016 21:26:19 -0400 X-JS-Flow: external X-JS-Scanner-attachment: (ok) No attachments Received: by tot-qpr-mailcore1 with JS-mailcore (0.1) (envelope-from ) id BXdca7-AAAD4X-Gu; 2016-06-30 21:26:19.216744-04:00 Received: from mail-qk0-f200.google.com ([209.85.220.200]) by mxgoog1.mail.janestreet.com with esmtps (UNKNOWN:AES128-GCM-SHA256:128) (Exim 4.72) (envelope-from ) id 1bInDn-00019M-57 for caml-list@inria.fr; Thu, 30 Jun 2016 21:26:19 -0400 Received: by mail-qk0-f200.google.com with SMTP id b136so46866489qkg.3 for ; Thu, 30 Jun 2016 18:26:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=janestreet.com; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=h457nB1xEgACi61H3NAIGyajzO/yzoRY5BUEJAnbIzg=; b=LJ5JGlu07G3vsdWyIcY2Vkd47Z/6f+a6nP/+bQ+TViKPfRQpqeAe0cB1R7E89z5NTK CgMY6KIOHlDogmfUabnWFYtBMTclf+2uBoou74EFhI0IRLmqyqpEhWlVBuN4pAcXgQF8 +EGV+t6FdbVXAhoJBtpBiuJQsdjCpXyArf0/0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=h457nB1xEgACi61H3NAIGyajzO/yzoRY5BUEJAnbIzg=; b=jA8DbP7HO0nv4+tHdoztaClllrHfGLTyG2kx3JCRl2GWweTd18vVxDMcU3jMylV6p+ /zgBzb7dpVPSl1hyHhPOUzCSqsdyHNy33wSBdlYfGciRYziWMXGKiLhifyaB7CYQUjDu 2bCvbQL7DZjrQjcRtmjTP0NBs9+T23CvI9KVuLW649WNiuIMMJZtDdyPxo+pds7SIZ7C 9ZtqMpTmgneYZKHkErfOyIBZFB+yKw7iafmIeZSg6NG9Us4pytKOYKLp6QHmdRqw+wE7 zMArV1EtXCzXZBFxJgnXOoR4bOU3ZdN3u3/FBljhzy+tO6S8jEeswJ3gvzhX597Y1Npu Y16Q== X-Gm-Message-State: ALyK8tJCw76wB1lAX71lXII5bBMT/XoUpjZISs3L+Ojpo9ZVj8mYRcRmelziZryvIcO2FziOm9/w+EqgAUYZOIRLWjWj/ZMp9rcrazKObeU6127VGJYKbeL2DUFsrW+r1JYvXW+LCyJsRdkxxFcsfqO2bsG7+KXWuE2UDKHHx/o= X-Received: by 10.129.53.139 with SMTP id c133mr8782108ywa.259.1467336378785; Thu, 30 Jun 2016 18:26:18 -0700 (PDT) X-Received: by 10.129.53.139 with SMTP id c133mr8782106ywa.259.1467336378516; Thu, 30 Jun 2016 18:26:18 -0700 (PDT) MIME-Version: 1.0 Received: by 10.37.52.200 with HTTP; Thu, 30 Jun 2016 18:26:17 -0700 (PDT) In-Reply-To: <20160701004152.GA23017@topoi.pooq.com> References: <7785E51D-EC74-4A78-8840-D4A7C18E3C56@gmail.com> <20160701004152.GA23017@topoi.pooq.com> From:Yaron Minsky Date: Thu, 30 Jun 2016 21:26:17 -0400 Message-ID: To:Hendrik Boom Cc:"caml-list@inria.fr" Content-Type: text/plain; charset=UTF-8 X-JS-Processed-by: mailcore Subject: Re: [Caml-list] Async and lwt The conceptual differences are pretty thin; there are some error handling differences, but they're not huge. As for the shared heap question: Async greatly improves the programmers ability to reason about concurrent code by providing clear bounds on when interleaving can happen. In particular, a given job scheduled to run as part of Async can never be interrupted by another async job. That means interleavings can effectively only happen where you use a bind operator to string two closures together, and so one is rarely exposed to race conditions. That means that Async program typically don't need to think much about locking, and race conditions stop being your primary source of bugs. Using Async in the context of shared heap parallelism gives up these guarantees, and puts you back in mutex/sempahore/condition-variable hell. My guess is that we'll end up taking advantage of the multicore GC by running multiple Async schedulers, one per domain (e.g., OS thread), and having carefully written primitives for sharing data-structures and efficiently sending immutable messages between these domains. But I think just freely scheduling Async jobs across multiple physical threads seems like a disaster from the point of view of producing comprehensible, reliable code. y On Thu, Jun 30, 2016 at 8:41 PM, Hendrik Boom wrote: > On Thu, Jun 30, 2016 at 08:13:58PM -0400, Yaron Minsky wrote: >> I'm not at all sure that the decoupling is possible or wise for Async. >> My intuition is that this is too complex of a problem with too much >> need for careful optimization to be able to have a simple, shared >> generic data structure for this. >> >> The solution that seems most plausible to me is to settle on one >> implementation, and port the API of one library to run on top of the >> other. There was indeed an experiment in this direction that was done >> by Jeremie Dimino: >> >> https://github.com/janestreet/lwt-async >> >> That said, until we resolve the binary size issues with Core and >> therefore Async, I doubt that this solution would be appealing to the >> full community of lwt users. > > What are the conceptual differences between Async and lwt? Does either > of them manage to take advantage of a shared-heap multicore system? > > -- hendrik > > -- > Caml-list mailing list. Subscription management and archives: > https://sympa.inria.fr/sympa/arc/caml-list > Beginner's list: http://groups.yahoo.com/group/ocaml_beginners > Bug reports: http://caml.inria.fr/bin/caml-bugs