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.70.49.16 with SMTP id q16mr19370913pdn.2.1421861691967; Wed, 21 Jan 2015 09:34:51 -0800 (PST) X-Received: by 10.140.98.198 with SMTP id o64mr3072qge.41.1421861691620; Wed, 21 Jan 2015 09:34:51 -0800 (PST) Path: border1.nntp.dca1.giganews.com!nntp.giganews.com!h15no1390437igd.0!news-out.google.com!l7ni1qai.0!nntp.google.com!v8no2609801qal.1!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Wed, 21 Jan 2015 09:34:51 -0800 (PST) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=80.223.109.117; posting-account=xMk30AoAAACEWgBjdZfjW9cEqRCtnf-j NNTP-Posting-Host: 80.223.109.117 References: <32208488-3a04-4d2a-8c64-840502dcf96d@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: Subject: Re: How to: communication between multiple tasks using protected objects - with no polling? From: Esa Riihonen Injection-Date: Wed, 21 Jan 2015 17:34:51 +0000 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Xref: number.nntp.giganews.com comp.lang.ada:191977 Date: 2015-01-21T09:34:51-08:00 List-Id: 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: >=20 > > 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'). > >=20 > > I first thought I can implement this by the 'select' - something like t= his: > >=20 > > PO1 and PO2 are instantiations of a protected type with entry 'Get'. > >=20 > > ... > > loop > > ... > > select > > PO1.Get(...); > > or > > PO2.Get(...); > > or=20 > > ... > > end select; > > ... > > end loop; >=20 > 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. >=20 > The publisher may call the consumer's entry or else queue the request int= o > 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 publishe= rs just report their state on certain points and then proceed immediately i= n their more important stuff and should not be blocked. I effect there is no queue inside my POs - just the most recent status info= rmation 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 blac= kboard. And instead of my teacher walking around checking whether the answe= r of any of the sudents is ready - I wan't to let the teacher doze in his/h= er chair and only be woken up when any of the students have their answer re= ady. And after the student briefly nudges the teacher he/she must be free t= o immediately continue with his/her other exams. I guess I just don't know how this 'blackboard' model should be implemented= ?