Re: C++ Threads, what's the status quo?
Thant Tessman wrote:
Lourens Veen wrote:
Thant Tessman wrote:
[...]
But you never have "actual concurrency" on a single CPU, regardless
of language or technique.
And there won't be many single CPU/core machines left in a decade or
so.
It's quite obvious that it doesn't matter on a single core machine.
My point (which I admit wasn't very clear) is that "actual concurrency"
from the programmer's point of view is an illusion. Even with multiple
CPUs it still is an illusion because there's no direct correlation
between threads and CPUs. Consequently, one should keep in mind that
problems 1 and 2 as described in my last post are two different problems.
No matter how much you clarify, you won't be able to justify your
statements that threading is a solved problem and that continuations
solve the threading problems discussed in this thread. The threading
problems essentially boil down to concurrent accesses to mutable shared
state. You can work around this by
(a) eliminating concurrent accesses, by using an illusion of
concurrency instead of actual concurrency (if you program only executes
on one core, it doesn't have any concurrency);
(b) eliminating shared state, by using processes and messages instead
of threads;
(c) eliminating mutable state, by using pure FP.
But this doesn't solve the original problem, it replaces it with a
different problem. Whether the replacement approaches are better than
just solving the original problem using synchronization and lock-free
primitives is not clear yet, despite all claims to the contrary.
--
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]