comp.lang.ada
 help / color / mirror / Atom feed
From: Niklas Holsti <niklas.holsti@tidorum.invalid>
Subject: Re: Concurrency always is non-deterministic?
Date: Mon, 13 Feb 2012 21:11:25 +0200
Date: 2012-02-13T21:11:25+02:00	[thread overview]
Message-ID: <9pt5itF1bdU1@mid.individual.net> (raw)
In-Reply-To: <3721724.784.1329154891821.JavaMail.geo-discussion-forums@pbcwt9>

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
       .      @       .



  parent reply	other threads:[~2012-02-13 19:11 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-13 17:41 Concurrency always is non-deterministic? Long Hoàng Đình
2012-02-13 18:04 ` Dmitry A. Kazakov
2012-02-13 19:38   ` Simon Wright
2012-02-13 19:56     ` Bill Findlay
2012-02-14  1:13       ` Simon Wright
2012-02-14 11:29         ` John B. Matthews
2012-02-14  2:34   ` Phil Clayton
2012-02-13 18:06 ` Georg Bauhaus
2012-02-13 19:11 ` Niklas Holsti [this message]
2012-02-13 22:10 ` Brian Drummond
2012-02-14  2:18 ` Phil Clayton
2012-02-14 10:05   ` Erich
2012-02-14 15:00     ` Phil Clayton
2012-02-14 18:23     ` Jeffrey Carter
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox