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 2002:a02:4f03:: with SMTP id c3mr2398774jab.13.1547798386009; Thu, 17 Jan 2019 23:59:46 -0800 (PST) X-Received: by 2002:a9d:da3:: with SMTP id 32mr293215ots.3.1547798385908; Thu, 17 Jan 2019 23:59:45 -0800 (PST) Path: eternal-september.org!reader01.eternal-september.org!feeder.eternal-september.org!news.uzoreto.com!2.eu.feeder.erje.net!4.us.feeder.erje.net!feeder.erje.net!feeder.usenetexpress.com!feeder-in1.iad1.usenetexpress.com!border1.nntp.dca1.giganews.com!nntp.giganews.com!q69no28591itb.0!news-out.google.com!v71ni66ita.0!nntp.google.com!q69no28588itb.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Thu, 17 Jan 2019 23:59:45 -0800 (PST) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=84.209.117.221; posting-account=bPTmZAoAAAC_6HP9XLKB9aAAxBa6BuOR NNTP-Posting-Host: 84.209.117.221 References: <949cfe5a-38ee-49bc-81c6-4fa8e4223289@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: Subject: Re: How to make a task wait and resume ? From: reinert Injection-Date: Fri, 18 Jan 2019 07:59:46 +0000 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Xref: reader01.eternal-september.org comp.lang.ada:55298 Date: 2019-01-17T23:59:45-08:00 List-Id: I suspected to be missing something :-) In my case, a user is normally actively interacting with the actual program which is about treating a large sequence of images. The user can start/stop= =20 a task which reads in images upfront to avoid waiting time. If the computer is weak (small ram) he/she sometimes has to stop the reading (and the progr= am automatically "clean" memory) and probably resume later. Hence the "sync= hronization" here is not with other tasks. reinert torsdag 17. januar 2019 23.28.17 UTC+1 skrev Randy Brukardt f=C3=B8lgende: > "Dmitry A. Kazakov" wrote in message=20 > 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= =20 > > object. >=20 > You could also use the built-in types for that purpose, see D.10,=20 > Synchronous Task Control. >=20 > ... > > If the pulse event to release several tasks it is a bit more complicate= d.=20 > > An example is in the Simple Components. >=20 > For that, you might want to use a Synchronous Barrier, see D.10.1. >=20 > For me, I would try to do this as part of other necessary synchronization= ,=20 > using usual task or protected operations. One rarely wants to have a task= =20 > wait in a vacuum. If I had to do it by iteself, however, I'd probably use= =20 > one of the built-in types (have to implement them in Janus/Ada, first,=20 > though :-). >=20 > Randy.