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:a6b:9612:: with SMTP id y18-v6mr1723659iod.107.1524083186538; Wed, 18 Apr 2018 13:26:26 -0700 (PDT) X-Received: by 2002:a9d:3051:: with SMTP id w17-v6mr221979otd.11.1524083186358; Wed, 18 Apr 2018 13:26:26 -0700 (PDT) Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!feeder.eternal-september.org!news.uzoreto.com!weretis.net!feeder6.news.weretis.net!feeder.usenetexpress.com!feeder-in1.iad1.usenetexpress.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!k65-v6no3855813ita.0!news-out.google.com!u64-v6ni7127itb.0!nntp.google.com!f63-v6no481338itc.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Wed, 18 Apr 2018 13:26:25 -0700 (PDT) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=2003:c7:83d7:a58d:dcb8:6d43:ca07:b1b; posting-account=rmHyLAoAAADSQmMWJF0a_815Fdd96RDf NNTP-Posting-Host: 2003:c7:83d7:a58d:dcb8:6d43:ca07:b1b References: <702e2422-a93f-4200-9749-5122c3d0f899@googlegroups.com> <04f19a56-7fab-416e-8ec0-b9a73e239e90@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: Subject: Re: Finalization of library level tasks From: AdaMagica Injection-Date: Wed, 18 Apr 2018 20:26:26 +0000 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Received-Bytes: 3920 X-Received-Body-CRC: 3442839967 Xref: reader02.eternal-september.org comp.lang.ada:51617 Date: 2018-04-18T13:26:25-07:00 List-Id: Am Mittwoch, 18. April 2018 17:04:58 UTC+2 schrieb Dmitry A. Kazakov: > On 18/04/2018 16:52, J-P. Rosen wrote: > > Le 18/04/2018 =C3=A0 16:12, Dmitry A. Kazakov a =C3=A9crit=C2=A0: > >> In pseudo-code: > >> > >> =C2=A0=C2=A0 task body Worker is > >> =C2=A0=C2=A0 begin > >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 while the object lives loop > >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 do some chunk of wor= k > >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 end loop; > >> =C2=A0=C2=A0 end Worker; > >> > >> P.S. I posted an example in a separate thread. The posted solution > >> should work except the cases when the access type is at the same level > >> as the object and both are below the library level. > >> > > OK. You were actually quite close... Use a killer task (with the same > > master as your worker) like this: > >=20 > > task Killer is > > entry Never_Called; > > end Killer; > >=20 > > task body Killer is > > begin > > accept Never_Called; > > exception > > when Tasking_Error =3D> > > -- Kill the other task > > end Killer; > >=20 > > Hint: when the master completes, Tasking_Error is raised in all tasks > > waiting on entries that depend on that master. >=20 > Does it raise for all entries? If it does no killer task is needed: >=20 > task body Worker is > begin > loop > begin > select > accept Never; > else > null; > end select; > exception > when Tasking_Eror =3D> > exit; > end; > do some chunk of work > end loop; > end Worker; >=20 > Should this work? No, because it's not waiting at the rendezvous.