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 Path: g2news1.google.com!news3.google.com!news4.google.com!news.glorb.com!news.agarik.com!194.2.0.24.MISMATCH!oleane.net!oleane!hunter.axlog.fr!nobody From: Jean-Pierre Rosen Newsgroups: comp.lang.ada Subject: Re: question about tasks, multithreading and multi-cpu machines Date: Thu, 16 Mar 2006 19:03:00 +0100 Organization: Adalog Message-ID: References: <1b9zea3ok5znb.13wc5k9as88ix.dlg@40tude.net> NNTP-Posting-Host: mailhost.axlog.fr Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-Trace: s1.news.oleane.net 1142535664 14444 195.25.228.57 (16 Mar 2006 19:01:04 GMT) X-Complaints-To: abuse@oleane.net NNTP-Posting-Date: Thu, 16 Mar 2006 19:01:04 +0000 (UTC) User-Agent: Thunderbird 1.5 (Windows/20051201) In-Reply-To: Xref: g2news1.google.com comp.lang.ada:3383 Date: 2006-03-16T19:03:00+01:00 List-Id: Maciej Sobczak a �crit : > 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). Actually, in Occam you would write (syntax not guaranteed): cobegin A:=7; and B:=8; coend; > Executing those two instructions in paraller should not require from me > to define new types, allocate new objects, nor any other thing like > this. And why? That's your opinion, fine, but what support do you have for it? The truth is that there are more than one concurrency paradigm. What you say is true for concurrent evaluation. You can have it in Ada (although it requires more typing) in the following: declare task T1; task body T1 is begin A := 7; end T1; task T2; task body T2 is begin B := 8; end T2; begin null; end; Another model of concurrency is for performing concurrent tasks (this last word in the usual sense). For example, imagine you want to display the time in the upper left corner of your screen. This can be done easily with something like: task Time_Display; task body Time_Display is begin loop Display (Clock); delay 1.0; end loop; end Time_Display; You cannot achieve this with any model of concurrent evaluation! -- --------------------------------------------------------- J-P. Rosen (rosen@adalog.fr) Visit Adalog's web site at http://www.adalog.fr