comp.lang.ada
 help / color / mirror / Atom feed
From: reinert <reinkor@gmail.com>
Subject: Re: How to make a task wait and resume ?
Date: Thu, 17 Jan 2019 23:59:45 -0800 (PST)
Date: 2019-01-17T23:59:45-08:00	[thread overview]
Message-ID: <caf4e246-030d-4da5-8c7d-db89497caaf6@googlegroups.com> (raw)
In-Reply-To: <q1qvhv$1jm$1@franka.jacob-sparre.dk>

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 
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 program automatically "clean" memory) and probably resume later. Hence the "synchronization" here is not with other tasks.

reinert

torsdag 17. januar 2019 23.28.17 UTC+1 skrev Randy Brukardt følgende:
> "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-18  7:59 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
2019-01-18  7:59     ` reinert [this message]
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