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.4 required=5.0 tests=BAYES_00,FORGED_MUA_MOZILLA autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,590b710e61b9ddf8 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,UTF8 Received: by 10.68.241.37 with SMTP id wf5mr10507941pbc.4.1329160286848; Mon, 13 Feb 2012 11:11:26 -0800 (PST) Path: wr5ni21097pbc.0!nntp.google.com!news1.google.com!news4.google.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Niklas Holsti Newsgroups: comp.lang.ada Subject: Re: Concurrency always is non-deterministic? Date: Mon, 13 Feb 2012 21:11:25 +0200 Organization: Tidorum Ltd Message-ID: <9pt5itF1bdU1@mid.individual.net> References: <3721724.784.1329154891821.JavaMail.geo-discussion-forums@pbcwt9> Mime-Version: 1.0 X-Trace: individual.net /aR7nuJuTwlWQ/eButaIUQdLIGitSHHNca84rzRjCnJhl2jRt0 Cancel-Lock: sha1:skV9lLZzjUsZ7rGzHycPAgtpGbI= User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:10.0.1) Gecko/20120208 Thunderbird/10.0.1 In-Reply-To: <3721724.784.1329154891821.JavaMail.geo-discussion-forums@pbcwt9> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Date: 2012-02-13T21:11:25+02:00 List-Id: On 12-02-13 19:41 , Long Hoàng Đình wrote: > The author of this post said so. If Ada were non-deterministic at concurrency, I guess it couldn't be real-time, right? > > http://ghcmutterings.wordpress.com/2009/10/06/parallelism-concurrency/ > > Please let me know your opinions about that post. It is a nice and clear position statement, with its own definitions of the terms. The author's main point is that when a program is multi-threaded (or multi-tasked, in Ada terms), with tasks that can have side effects on shared data, then the results computed can depend on the order in which the tasks are scheduled and executed (on one or several cores). This is what the author calls "non-deterministic" concurrent execution. As the author says, to write such a program, the programmer must usually make careful use of task synchronization and control access to shared data. Ada has nice high-level features for that. On the other hand, if all computations use only private data (and do not include non-deterministic data such as inputs or clock readings in their computations) then the end result does not depend on the order or timing of the computations (whether divided into tasks or not), even if they are executed in parallel on many cores. This is what the author calls deterministic parallel execution. In other words, the programmer does not have to consider task scheduling or synchronization; that is handled by the compiler and run-time system. However, for most real-time programs "non-determinism" in the author's sense is desirable, because the results of the computation are *required* to depend on timing, inputs, and clock-readings. Moreover, in real-time programs, tasks must be executed at certain times, as specified in the program -- whether or not the tasks share data. The right conclusion is therefore the opposite: using the author's terms, "deterministic parallelism" is unusable for real-time systems, because real-time systems must be "non-deterministic". Note that the author's term "non-deterministic" does not imply "unreliable" or "unpredictable". -- Niklas Holsti Tidorum Ltd niklas holsti tidorum fi . @ .