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=ham autolearn_force=no version=3.4.4 X-Google-Thread: a07f3367d7,8e11100f675ea2df X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit X-Received: by 10.66.80.34 with SMTP id o2mr7965818pax.9.1357498038136; Sun, 06 Jan 2013 10:47:18 -0800 (PST) From: Jeffrey Carter Newsgroups: comp.lang.ada Subject: Re: asynchronous task communication Date: Tue, 01 Jan 2013 05:32:44 -0700 Organization: Also freenews.netfront.net; news.tornevall.net Message-ID: References: <1c2dnd5E6PMDR33NnZ2dnUVZ_sednZ2d@earthlink.com> <50e18094$0$6583$9b4e6d93@newsspool3.arcor-online.net> <7NednS4s2oukfXzNnZ2dnUVZ_oadnZ2d@earthlink.com> <7cudnYloBfQDw3_NnZ2dnUVZ_rKdnZ2d@earthlink.com> Mime-Version: 1.0 Injection-Date: Tue, 1 Jan 2013 12:32:44 +0000 (UTC) Injection-Info: mx04.eternal-september.org; posting-host="3f4eb2af76c3de211f80e174daf29eb8"; logging-data="9593"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19SZt8Cd+il3sQ/ntsoX84nXDwoimzI+r8=" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/17.0 Thunderbird/17.0 In-Reply-To: <7cudnYloBfQDw3_NnZ2dnUVZ_rKdnZ2d@earthlink.com> Cancel-Lock: sha1:rh/ftaC0DCoqMcKqdp6XKRZoQx0= Path: 6ni88791pbd.1!nntp.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!news.mccarragher.com!news.grnet.gr!de-l.enfer-du-nord.net!feeder2.enfer-du-nord.net!eternal-september.org!feeder.eternal-september.org!mx04.eternal-september.org!.POSTED!not-for-mail Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Date: 2013-01-01T05:32:44-07:00 List-Id: On 12/31/2012 08:51 PM, Charles Hixson wrote:> > FWIW, you can think of what I'm doing is a neural network simulation. There > are reasons why that isn't quite accurate, but it's close. And each message > is likely (but not certain) to get a reply and may also cause further > messages to be sent on. Occasionally new nodes will be added to the net. So > logically, each "cell" should be a separate task, but even so asynchronous > communication is needed to avoid deadlock. I actually wrote such a thing in Ada 83, a tasking implementation of a neural network with feedback connections. Each node was a task, and any 2 nodes which were connected had a bounded, blocking queue of length 1 between them. There were cycles in the network (feedback), but this structure worked well and did not deadlock. Being Ada 83, each queue was also a task. There were fewer than 100 total tasks, but then this was a 286-class DOS computer with about 1 MB of RAM, and it could have handled more such tasks; I never tested to determine the maximum it could run. On a modern, multi-core processor, and using protected objects for the queues, I doubt that a million nodes would be a problem. I don't know whether such an approach would work for your problem; we used a static network layout, for example, so adding nodes was not considered. At the time I wrote that network, most people writing concurrent S/W would have told me that such a design would not work and I would have to use a cyclic executive. My experience, and that reported in every paper by people who used Ada(-83) tasks as intended, was otherwise. Such people were writing unnecessarily complex code because of premature optimization. Modern Ada S/W engineers like you and me would never make such an error, would we? -- Jeff Carter "We call your door-opening request a silly thing." Monty Python & the Holy Grail 17