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: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!mx02.eternal-september.org!feeder.eternal-september.org!newsfeed.Update.UU.SE!news.Update.UU.SE!news.stack.nl!usenet.blueworldhosting.com!feeder01.blueworldhosting.com!peer01.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!post01.iad.highwinds-media.com!fx07.iad.POSTED!not-for-mail From: Hubert User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: How to: communication between multiple tasks using protected objects - with no polling? References: <32208488-3a04-4d2a-8c64-840502dcf96d@googlegroups.com> In-Reply-To: Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Antivirus: avast! (VPS 150121-1, 01/21/2015), Outbound message X-Antivirus-Status: Clean Message-ID: <8xWvw.618732$ZT5.570497@fx07.iad> X-Complaints-To: abuse@newsdemon.com NNTP-Posting-Date: Wed, 21 Jan 2015 23:22:44 UTC Organization: http://www.NewsDemon.com Date: Wed, 21 Jan 2015 15:22:49 -0800 X-Received-Bytes: 2202 X-Received-Body-CRC: 4052699529 Xref: news.eternal-september.org comp.lang.ada:24686 Date: 2015-01-21T15:22:49-08:00 List-Id: 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. 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. --- This email has been checked for viruses by Avast antivirus software. http://www.avast.com