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: 103376,3f60acc31578c72b X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news1.google.com!newsfeed.gamma.ru!Gamma.RU!image.surnet.ru!newsfeed.vmunix.org!newsfeed.hanau.net!news-fra1.dfn.de!kanaga.switch.ch!news-zh.switch.ch!switch.ch!cernne03.cern.ch!cern.ch!news From: Maciej Sobczak Newsgroups: comp.lang.ada Subject: Re: question about tasks, multithreading and multi-cpu machines Date: Thu, 16 Mar 2006 16:50:45 +0100 Organization: CERN - European Laboratory for Particle Physics Message-ID: References: <1b9zea3ok5znb.13wc5k9as88ix.dlg@40tude.net> NNTP-Posting-Host: abpc10883.cern.ch Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Trace: sunnews.cern.ch 1142524245 6996 (None) 137.138.37.241 X-Complaints-To: news@sunnews.cern.ch User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.12) Gecko/20060203 Red Hat/1.7.12-1.1.3.4 X-Accept-Language: en-us, en In-Reply-To: <1b9zea3ok5znb.13wc5k9as88ix.dlg@40tude.net> Xref: g2news1.google.com comp.lang.ada:3381 Date: 2006-03-16T16:50:45+01:00 List-Id: Dmitry A. Kazakov wrote: > Hmm, if task type is a type [...] Why *should* it be a type in the first place? :) > What could be an alternative? The difference between sequential and paraller execution of two instructions (or blocks of instructions, but that's obvious) should be addressed at the level of control structures, not types (nor objects). This means that if I want to have these: A := 7; B := 8; executed sequentially, then I write them sequentially - just like above (I already see posts claiming that the compiler or CPU can reorder these instructions, but that's not the point; if the instructions have side-effects, then the sequence is really a sequence and I'm talking about expressing the programmer's intents here). Executing those two instructions in paraller should not require from me to define new types, allocate new objects, nor any other thing like this. Think about it in terms of UML activity diagrams. The difference between sequential and paraller execution is just a plain syntax issue, without introducing any additional and dedicated entities. The same should be possible on the level of source code - especially if we take into account that diagrams and source code should be just two ways to say the same thing. I have no serious thoughts about Ada in this aspect - for the simple reason that I'm learning Ada and I don't know where my reasoning could possibly break. However, for your amusement, you might take a look at the small article that I wrote about the same thing but w.r.t. C++: http://www.msobczak.com/prog/articles/threadscpp.html Just changing curly brackets to "begin" and "end" might not be enough, but you should get the idea. In short, the point is that concurrency should be handled at the level of control statements, without requiring any additional entities (type, object, etc.) for reasons other than communication and synchronization. Only then I'm ready to admit that the given language has a *built-in* support for concurrency. :) -- Maciej Sobczak : http://www.msobczak.com/ Programming : http://www.msobczak.com/prog/