comp.lang.ada
 help / color / mirror / Atom feed
From: "Randy Brukardt" <randy@rrsoftware.com>
Subject: Re: How to make a task wait and resume ?
Date: Thu, 17 Jan 2019 16:28:15 -0600
Date: 2019-01-17T16:28:15-06:00	[thread overview]
Message-ID: <q1qvhv$1jm$1@franka.jacob-sparre.dk> (raw)
In-Reply-To: q1qe0o$1te0$1@gioia.aioe.org


"Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> 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.


  reply	other threads:[~2019-01-17 22:28 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-17 16:21 How to make a task wait and resume ? reinert
2019-01-17 17:28 ` Dmitry A. Kazakov
2019-01-17 22:28   ` Randy Brukardt [this message]
2019-01-18  7:59     ` reinert
2019-01-18 10:20       ` Dmitry A. Kazakov
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox