From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!mx02.eternal-september.org!feeder.eternal-september.org!aioe.org!.POSTED!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: Asynchronicity and Promises Date: Wed, 28 Oct 2015 19:46:32 +0100 Organization: cbb software GmbH Message-ID: <1qrjm5vaptsw$.14uwmxveagjrt$.dlg@40tude.net> References: <3dd39b8d-d1ad-43b0-bd20-b5248d0aeff8@googlegroups.com> Reply-To: mailbox@dmitry-kazakov.de NNTP-Posting-Host: j6IQVb9uobzjXrpQLDU2rQ.user.speranza.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Complaints-To: abuse@aioe.org User-Agent: 40tude_Dialog/2.0.15.1 X-Notice: Filtered by postfilter v. 0.8.2 Xref: news.eternal-september.org comp.lang.ada:28094 Date: 2015-10-28T19:46:32+01:00 List-Id: On Wed, 28 Oct 2015 08:33:56 -0700 (PDT), brbarkstrom@gmail.com wrote: On Wed, 28 Oct 2015 08:33:56 -0700 (PDT), in comp.lang.ada you wrote: > There's an interesting blog on Asynchronicity and Promises at [...] > I think we've had some discussion in other e-mail threads here. > As far as I've been able to follow the discussion, we don't seem > to have settled the issue about how Ada could handle contract > "Promises" - although it looked like we had begun to converge > on some useful potential approaches. Ada had this since Ada 95 in the form of a protected object. Protected object's state is waitable. That gives you everything you need to design things described. They are not 100% asynchronous because the caller waits for the callee at some point anyway. As a side note, usefulness of this approach is questionable. I can judge, because this sort of objects and asynchronous execution has been used in the middleware for 20+ years. A lot of use cases to be sure. It is certainly neither natural nor composable and works at the low level only. To be honest, I know no better way, but you must clearly understand limitations of the approach, e.g. a total lack of scalability. Ada's concurrency model has much more to offer and at the higher level as well. P.S. What wonders me is that the author is seemingly unaware of 30+ years of OS having asynchronous I/O and waitable objects. Just google for Windows GetOverlappedResult. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de