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.66.65.169 with SMTP id y9mr935605pas.21.1421933073062; Thu, 22 Jan 2015 05:24:33 -0800 (PST) X-Received: by 10.140.104.12 with SMTP id z12mr479qge.40.1421933073012; Thu, 22 Jan 2015 05:24:33 -0800 (PST) Path: border2.nntp.dca1.giganews.com!border1.nntp.dca1.giganews.com!nntp.giganews.com!hl2no1083425igb.0!news-out.google.com!l7ni1qai.0!nntp.google.com!v8no2784299qal.1!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Thu, 22 Jan 2015 05:24:32 -0800 (PST) In-Reply-To: <8xWvw.618732$ZT5.570497@fx07.iad> Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=130.232.105.117; posting-account=xMk30AoAAACEWgBjdZfjW9cEqRCtnf-j NNTP-Posting-Host: 130.232.105.117 References: <32208488-3a04-4d2a-8c64-840502dcf96d@googlegroups.com> <8xWvw.618732$ZT5.570497@fx07.iad> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <3b5579ff-6a7c-48a7-9fa1-3213ca31c5bf@googlegroups.com> Subject: Re: How to: communication between multiple tasks using protected objects - with no polling? From: Esa Riihonen Injection-Date: Thu, 22 Jan 2015 13:24:33 +0000 Content-Type: text/plain; charset=ISO-8859-1 Xref: number.nntp.giganews.com comp.lang.ada:191997 Date: 2015-01-22T05:24:32-08:00 List-Id: torstai 22. tammikuuta 2015 1.22.45 UTC+2 Hubert kirjoitti: > the point of a protected object here is that the code each task spends > in it should be small, just enough to add an entry to a list or so. > When you send a message to a task, it can be that the task is involved > in a lengthy operatin and thus your task has to wait until the received > task can accept it. > > You could also make a more complex setup, perhaps something like > > Tx1 -> Pox1 -> Tx2 -> Po-final ->Tfinal > Ty2 -> Poy2 -> Ty2 ^ > > and then Have one output PO per worker task and each has it's own task > to forward the data to the final PO from which the final task fetches it > or so. > The Ada tasking system is easy enough to use to set up stuff like this > pretty quickly and when tasks sleep waiting for an entry they dont eat time. That surely looks promising - AFAICT this was the model that someone other was also proposing "forwarder tasks". > Just you have to be careful about the maximimum NOF tasks your system > can support which is, I believe, depended on the underlying OS. But in > my experience a few dozen are not problem, pehraps even a few 100, > depending on how much stack each underlying thread reserves. But I > wasn't able to get any hard data on that. My C-program consists of something like 10 processes currently. So, even if I end up to a full scale Ada implementation with added forwarder tasks, we are still speaking of about a couple of dozen tasks max. Thanks alot again for the insight.