comp.lang.ada
 help / color / mirror / Atom feed
From: Maciej Sobczak <no.spam@no.spam.com>
Subject: Re: question about tasks, multithreading and multi-cpu machines
Date: Thu, 16 Mar 2006 16:50:45 +0100
Date: 2006-03-16T16:50:45+01:00	[thread overview]
Message-ID: <dvc1gl$6qk$1@sunnews.cern.ch> (raw)
In-Reply-To: <1b9zea3ok5znb.13wc5k9as88ix.dlg@40tude.net>

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/



  parent reply	other threads:[~2006-03-16 15:50 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-03-14 16:26 question about tasks, multithreading and multi-cpu machines Norbert Caspari
2006-03-14 16:51 ` Pascal Obry
2006-03-16  4:27   ` Norbert Caspari
2006-03-16 10:04     ` Alex R. Mosteo
2006-03-14 17:18 ` Jean-Pierre Rosen
2006-03-16  4:22   ` Norbert Caspari
2006-03-16  6:58     ` Jean-Pierre Rosen
2006-03-14 18:49 ` Martin Krischik
2006-03-14 18:56 ` tmoran
2006-03-14 23:01 ` Jeffrey Creem
2006-03-15  1:15   ` Jeffrey R. Carter
2006-03-16  8:06   ` Maciej Sobczak
2006-03-16 10:23     ` Ole-Hjalmar Kristensen
2006-03-16 12:59     ` Dmitry A. Kazakov
2006-03-16 15:11       ` Larry Kilgallen
2006-03-16 15:50       ` Maciej Sobczak [this message]
2006-03-16 18:03         ` Jean-Pierre Rosen
2006-03-16 20:06           ` Dr. Adrian Wrigley
2006-03-17  3:26       ` Randy Brukardt
2006-03-16 20:06     ` Jeffrey R. Carter
2006-03-17  8:22       ` Maciej Sobczak
2006-03-17 11:36         ` Dmitry A. Kazakov
2006-03-17 14:23           ` Maciej Sobczak
2006-03-17 19:10             ` Dmitry A. Kazakov
2006-03-17 19:42         ` Jeffrey R. Carter
2006-03-18  0:27           ` tmoran
2006-03-25 21:28     ` Robert A Duff
     [not found]       ` <43gb22h4811ojjh308r2lqf5qqrujijjok@4ax.com>
2006-03-26  0:44         ` Robert A Duff
2006-03-15  6:46 ` Simon Wright
replies disabled

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