Re: Threading in new C++ standard
On Apr 25, 2:43 am, "Chris Thomasson" <cris...@comcast.net> wrote:
"Szabolcs Ferenczi" <szabolcs.feren...@gmail.com> wrote in message
news:68977d32-c840-4029-a3f1->
I really believe
that you should try to read the B=F6hm paper. If not for your own sake=
,
then for ours ;-)
Of course I have read it already before I have made my first
contribution to this discussion thread.
Maybe he should have said "understood it", then.
[...]
The whole discussion is built on the assumption: what if
you do not know how to write a correct concurrent program and you use
shared variables without any protection.
Not really. The thrust of Boehm's article is that specifying
when protection is needed, and when it isn't, is a language
issue. Compilers can move code around, and on modern
processors, read and write pipelines also mean that register
loads and stores don't map immediately to memory cycles unless
the compiler generates special instructions around them. The
language has to specify what the compiler is allowed to do, and
what it must do.
I suggest you to study concurrent programming and then
re-read the Boehm paper. You will be surprised.
I suggest you learn about low-level high-performance
multi-threading algorithms. C++ will have efficient support
for them in the form of standardized fine-grain atomic
operations and memory barriers.
Which is a good thing, in itself, but even without such support,
the language still has to address the fundamental issues of
memory synchronization. (Similarly, whether the programmer API
is built into the language, as in Java, or is in the library, as
will be the case in C++, doesn't fundamentally change anything
in this regard.)
--
James Kanze (GABI Software) email:james.kanze@gmail.com
Conseils en informatique orient=E9e objet/
Beratung in objektorientierter Datenverarbeitung
9 place S=E9mard, 78210 St.-Cyr-l'=C9cole, France, +33 (0)1 30 23 00 34