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=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no 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.84.98 with SMTP id x2mr7637444pay.10.1357498037053; Sun, 06 Jan 2013 10:47:17 -0800 (PST) From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: asynchronous task communication Date: Tue, 1 Jan 2013 10:59:30 +0100 Organization: cbb software GmbH Message-ID: References: <1c2dnd5E6PMDR33NnZ2dnUVZ_sednZ2d@earthlink.com> <50e18094$0$6583$9b4e6d93@newsspool3.arcor-online.net> <7NednS4s2oukfXzNnZ2dnUVZ_oadnZ2d@earthlink.com> <7cudnYloBfQDw3_NnZ2dnUVZ_rKdnZ2d@earthlink.com> Reply-To: mailbox@dmitry-kazakov.de NNTP-Posting-Host: cDN0fd8KlIeJLyErIrSf0A.user.speranza.aioe.org Mime-Version: 1.0 X-Complaints-To: abuse@aioe.org User-Agent: 40tude_Dialog/2.0.15.1 X-Notice: Filtered by postfilter v. 0.8.2 Path: 6ni88791pbd.1!nntp.google.com!border1.nntp.dca.giganews.com!border4.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!news.mccarragher.com!news.grnet.gr!de-l.enfer-du-nord.net!feeder1.enfer-du-nord.net!feeder2.enfer-du-nord.net!cs.uu.nl!news.stack.nl!aioe.org!.POSTED!not-for-mail Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Date: 2013-01-01T10:59:30+01:00 List-Id: On Mon, 31 Dec 2012 19:51:36 -0800, Charles Hixson wrote: > My application logically "needs" thousands or millions of tasks. An OS can support no more than few hundred task. > FWIW, you can think of what I'm doing is a neural network simulation. Well, it is a kind of structure (data-driven machine) which is very difficult for concurrent computing based on traditional architectures. Even if you could have a task per node/cell, the performance could be actually worse due to task switching, which would eat most of the resources. > Since I can't model cells as tasks, I'm planning on modeling them as > protected variables. I would not do that. There is a possibility that protected actions would use system-wide locks. And it is a very bad idea to do perform anything time consuming (e.g. calculations) from a protected action. Logically a protected action is considered "instant." For a NN, if you really wanted to experiment with concurrency, I would use a pool of tasks (there already were good advices how many of them make sense to have on a multi-core). The tasks would service groups of nodes of the same layer. For data you would need no locking at all, since the layer N+1 would not start before the layer N is completed. For a completely data-driven architecture I would again recommend a pool of tasks looking into a blackboard for requests [lock-free]. As I said there is a fair possibility that you would actually lose more than gain, but you could try. [lock-free FIFO is for 1-1, blackboard for 1-n producer-consumer scenarios]. Happy New Year to all, -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de