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 autolearn=unavailable autolearn_force=no version=3.4.4 Path: border2.nntp.dca1.giganews.com!nntp.giganews.com!newspeer1.nac.net!feeder.erje.net!eu.feeder.erje.net!news.swapon.de!eternal-september.org!feeder.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail From: G.B. Newsgroups: comp.lang.ada Subject: Re: How to: communication between multiple tasks using protected objects - with no polling? Date: Thu, 22 Jan 2015 21:52:17 +0000 (UTC) Organization: A noiseless patient Spider Message-ID: <204973896443655271.096946nonlegitur-futureapps.invalid@reader80.eternal-september.org> References: <87a91c0xpq.fsf@adaheads.sparre-andersen.dk> <1x7jndf8up05d.1n1l3ck15y1lf.dlg@40tude.net> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Injection-Date: Thu, 22 Jan 2015 21:52:17 +0000 (UTC) Injection-Info: mx02.eternal-september.org; posting-host="91f4fd9ed69fc6fb813a8bc1041b8510"; logging-data="25879"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+BHKzOynuJT9NhFvQz/2kXEoy+3uv4FHw=" User-Agent: NewsTap/3.5.5 (iPad) Cancel-Lock: sha1:0GwBa5vvetotFvFj2b/KD5NKBPw= Xref: number.nntp.giganews.com comp.lang.ada:192011 Date: 2015-01-22T21:52:17+00:00 List-Id: "Dmitry A. Kazakov" wrote: > On Wed, 21 Jan 2015 19:56:17 +0100, Jacob Sparre Andersen wrote: >> To me it sounds like a single protected object for storing the state of >> all the workers (students) makes most sense. The workers can push in >> their most recent state through a (common) protected procedure. The >> master (teacher) blocks on a protected entry until at least one worker >> has updated its state. > > Right, though this works only with a single subscriber (the teacher). > Usually there are more than one . The PO and the teacher task(s) could share a suspension object (one for each teacher). When the PO has collected enough items, it calls Set_True on some suspension object to wake the teacher task up.