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.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM 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!news.eternal-september.org!.POSTED!not-for-mail From: =?UTF-8?Q?Bj=c3=b6rn_Lundin?= Newsgroups: comp.lang.ada Subject: Re: Tasking without Protected Objects. Date: Tue, 31 Jan 2017 17:53:23 +0100 Organization: A noiseless patient Spider Message-ID: References: <095bc904-c60a-4521-a1a2-8f8b095a4b53@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Date: Tue, 31 Jan 2017 16:51:56 -0000 (UTC) Injection-Info: mx02.eternal-september.org; posting-host="3767b03cbd7a1eb2db566c55ddf7824b"; logging-data="30185"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18VQy3Wwc3JNQXcwBQmP1T6" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Icedove/45.6.0 In-Reply-To: <095bc904-c60a-4521-a1a2-8f8b095a4b53@googlegroups.com> Cancel-Lock: sha1:UK7dlADAlbACxZl+rdE4yEloMtk= Xref: news.eternal-september.org comp.lang.ada:33222 Date: 2017-01-31T17:53:23+01:00 List-Id: On 2017-01-31 15:33, patrick@spellingbeewinnars.org wrote: > Hi Everyone > > I haven't been able to program much over the past month or two, what I have written in Ada are toy sized. > > For fun I have been trying to restrict myself to Ada 83 with the use of Pragma Ada_83 . > > I am assuming that if Ada 83 sucked so bad then there would have been an Ada 84 revision not Ada 95. > > I don't think I need very complex tasking. I don't think I need one task to call another, > I just need the main task/thread to communicate with the other tasks. > I am trying not to use the protected object feature from Ada 95, > I am hoping shared variables will work. > A common pattern in our old code was to have a serializing tasks. That is a task that today would have been written as a protected object. It held the data in local structures - perhaps in its body or in a package body that only this task could access. Then, the rest of the tasks as well as the main thread, accessed the data via the serialization task. -- -- Björn