comp.lang.ada
 help / color / mirror / Atom feed
From: Esa Riihonen <esa.riihonen.er@gmail.com>
Subject: Re: How to: communication between multiple tasks using protected objects - with no polling?
Date: Wed, 21 Jan 2015 09:34:51 -0800 (PST)
Date: 2015-01-21T09:34:51-08:00	[thread overview]
Message-ID: <c7928000-e3f5-4555-823a-f0e73fca572e@googlegroups.com> (raw)
In-Reply-To: <gyevhk092i9e$.69gw5gvohmfu$.dlg@40tude.net>

keskiviikko 21. tammikuuta 2015 10.28.08 UTC+2 Dmitry A. Kazakov kirjoitti:
> On Tue, 20 Jan 2015 14:36:20 -0800 (PST), Esa Riihonen wrote:
> 
> > Here is the problem. My typical C-process 'listens' to several FIFOs
> > connected to separate processes. This is realized using a ppoll-type
> > 'reactor' - so in essence the process is sleeping until there is some
> > activity in any of the monitored file descriptors (I guess this is in
> > essence quite basic arrangement in the 'C-world').
> > 
> > I first thought I can implement this by the 'select' - something like this:
> > 
> > PO1 and PO2 are instantiations of a protected type with entry 'Get'.
> > 
> > ...
> > loop
> >   ...
> >   select
> >     PO1.Get(...);
> >   or
> >     PO2.Get(...);
> >   or 
> >     ...
> >   end select;
> >   ...
> > end loop;
> 
> The typical design of 1-n is reverse: the publisher queues request to the
> consumer rather than lets the consumer to come and pick it.
> 
> The publisher may call the consumer's entry or else queue the request into
> a queue. If publishers shall not be blocked (e.g. in order to prevent
> priority inversion or due to time constraints), also when it is n-m, use
> the blackboard instead of a queue.

Thansk for the answer - and yes, the last one is my situation: the publishers just report their state on certain points and then proceed immediately in their more important stuff and should not be blocked.
I effect there is no queue inside my POs - just the most recent status information from the associated task - I guess this is at least some kind of a 'blackboard'.

So - in my mind I have a small number of students each with a separete blackboard. And instead of my teacher walking around checking whether the answer of any of the sudents is ready - I wan't to let the teacher doze in his/her chair and only be woken up when any of the students have their answer ready. And after the student briefly nudges the teacher he/she must be free to immediately continue with his/her other exams.

I guess I just don't know how this 'blackboard' model should be implemented?


  reply	other threads:[~2015-01-21 17:34 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-20 22:36 How to: communication between multiple tasks using protected objects - with no polling? Esa Riihonen
2015-01-21  0:19 ` Hubert
2015-01-21 16:53   ` Esa Riihonen
2015-01-21 23:22     ` Hubert
2015-01-22 13:24       ` Esa Riihonen
2015-01-21  0:47 ` Jeffrey Carter
2015-01-21  8:11   ` Simon Wright
2015-01-21 17:16   ` Esa Riihonen
2015-01-21 18:39     ` Jeffrey Carter
2015-01-22 13:32       ` Esa Riihonen
2015-01-21  8:28 ` Dmitry A. Kazakov
2015-01-21 17:34   ` Esa Riihonen [this message]
2015-01-21 18:56     ` Jacob Sparre Andersen
2015-01-21 20:15       ` Dmitry A. Kazakov
2015-01-22 21:52         ` G.B.
2015-01-23  8:25           ` Dmitry A. Kazakov
2015-01-21 20:02     ` Dmitry A. Kazakov
2015-01-22 13:37       ` Esa Riihonen
replies disabled

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