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 autolearn=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!feeder.eternal-september.org!gandalf.srv.welterde.de!news.jacob-sparre.dk!franka.jacob-sparre.dk!pnx.dk!.POSTED.rrsoftware.com!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: How to make a task wait and resume ? Date: Thu, 17 Jan 2019 16:28:15 -0600 Organization: JSA Research & Innovation Message-ID: References: <949cfe5a-38ee-49bc-81c6-4fa8e4223289@googlegroups.com> Injection-Date: Thu, 17 Jan 2019 22:28:16 -0000 (UTC) Injection-Info: franka.jacob-sparre.dk; posting-host="rrsoftware.com:24.196.82.226"; logging-data="1654"; mail-complaints-to="news@jacob-sparre.dk" X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.5931 X-RFC2646: Format=Flowed; Response X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.7246 Xref: reader01.eternal-september.org comp.lang.ada:55297 Date: 2019-01-17T16:28:15-06:00 List-Id: "Dmitry A. Kazakov" wrote in message news:q1qe0o$1te0$1@gioia.aioe.org... > On 2019-01-17 17:21, reinert wrote: > >> I have used a protected object to control (from "outside") >> wait/resume of a task. It works, but is it good practise? > > Why not? In other cases you might use a task entry instead of protected > object. You could also use the built-in types for that purpose, see D.10, Synchronous Task Control. ... > If the pulse event to release several tasks it is a bit more complicated. > An example is in the Simple Components. For that, you might want to use a Synchronous Barrier, see D.10.1. For me, I would try to do this as part of other necessary synchronization, using usual task or protected operations. One rarely wants to have a task wait in a vacuum. If I had to do it by iteself, however, I'd probably use one of the built-in types (have to implement them in Janus/Ada, first, though :-). Randy.