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.236.123.68 with SMTP id u44mr11695452yhh.19.1401188904380; Tue, 27 May 2014 04:08:24 -0700 (PDT) X-Received: by 10.140.109.199 with SMTP id l65mr2104qgf.32.1401188904264; Tue, 27 May 2014 04:08:24 -0700 (PDT) Path: border2.nntp.dca3.giganews.com!backlog4.nntp.dca3.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!news-in-01.newsfeed.easynews.com!easynews.com!easynews!news.glorb.com!c1no18174001igq.0!news-out.google.com!qf4ni13600igc.0!nntp.google.com!c1no18173996igq.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Tue, 27 May 2014 04:08:24 -0700 (PDT) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=155.210.219.57; posting-account=pwYQiQkAAAA3aYJLpu5F4Anl_UXMyGLQ NNTP-Posting-Host: 155.210.219.57 References: User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <91780287-64c4-48e4-8cb1-89909b5d59f9@googlegroups.com> Subject: Re: Termination of tasks waiting on a protected queue From: "Alejandro R. Mosteo" Injection-Date: Tue, 27 May 2014 11:08:24 +0000 Content-Type: text/plain; charset=ISO-8859-1 X-Received-Bytes: 2630 X-Original-Bytes: 2710 Xref: number.nntp.dca.giganews.com comp.lang.ada:186646 Date: 2014-05-27T04:08:24-07:00 List-Id: On Monday, May 19, 2014 1:05:59 AM UTC+2, Brad Moore wrote: > On 14-05-18 01:32 AM, Natasha Kerensikova wrote: > > > The problem is, how to terminate cleanly the worker tasks in a > > > non-Ravenscar environment when the main application is completed? > > > > > > From my understanding of ARM 9.3, I need a terminate alternative in the > > > worker tasks. But those can only exist in selective accepts, so I have > > > to turn things around and make the task wait for one of its entries to > > > be called, rather than wait for an external protected entry. > > > > > > But then, how can a worker task entry be used to solve my problem? A > > > protected operation cannot call a task entry, because it's potentially > > > blocking. The job generator cannot call the entry directly, because it > > > would block when the task is not ready, so I still need a queue between > > > the generator and the worker task. > > > > A protected entry can however requeue to a task entry. > > > > I was faced with a similar problem in the non-Ravenscar task pools in > > Paraffin. > > > > I did not want the programmer to have to call some protected subprogram > > to trigger the task pool to terminate. Could an atomic boolean be used to avoid a protected object? Given that after it being set it wouldn't be unset, and there's no race condition, I wonder.