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=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM autolearn=unavailable autolearn_force=no version=3.4.4 X-Received: by 10.98.23.84 with SMTP id 81mr4117331pfx.7.1472085677174; Wed, 24 Aug 2016 17:41:17 -0700 (PDT) X-Received: by 10.157.24.83 with SMTP id t19mr559905ott.17.1472085677093; Wed, 24 Aug 2016 17:41:17 -0700 (PDT) Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!news.eternal-september.org!feeder.eternal-september.org!news.glorb.com!f6no12730847ith.0!news-out.google.com!d130ni45887ith.0!nntp.google.com!f6no12730836ith.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Wed, 24 Aug 2016 17:41:16 -0700 (PDT) Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=2601:18f:900:8350:9d2c:f7d8:407a:e15; posting-account=3pYsyQoAAACcI-ym7XtMOI2PDU8gRZS5 NNTP-Posting-Host: 2601:18f:900:8350:9d2c:f7d8:407a:e15 User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <35ae841e-5947-44e9-a8d4-479cf40c4277@googlegroups.com> Subject: How to simulate semaphores with Ada's tasks? From: Andrew Shvets Injection-Date: Thu, 25 Aug 2016 00:41:17 +0000 Content-Type: text/plain; charset=UTF-8 Xref: news.eternal-september.org comp.lang.ada:31558 Date: 2016-08-24T17:41:16-07:00 List-Id: >From what I've read, tasks do not have semaphores that can permit it to lock a piece of memory and prevent it from being accessed, is this correct? If so, then the best possible way to simulate this is to have tasks send messages to one another and synchronize when something is locked/unlocked. Is there a better approach?