On Tue, 27 Oct 2026 09:06:26 +0100 David Brown <davi…@hesbynett.no> wrote:
> On 27/10/2026 04:44, Chris M. Thomasson wrote:
> > On 10/25/2026 2:45 AM, David Brown wrote:
>
> >> No one is suggesting that the threads themselves are implemented > >> in pure, standard, portable C++.  You need an underlying OS or > >> support of some sort if you are going to have preemptable threads. > >> It's the same principle as IO and file access. > >> > >> But the difference between threads and processes is very simple > >> from the viewpoint of C and C++.  Suppose you have a global (i.e., > >> external linkage) variable : > >> > >>      int x; > >> > >> Two threads that have "int a = x;" see the same "x" (ignoring data > >> races and synchronisation).  Two processes see completely > >> different "x".[...]
> > > > Bingo. So, trying to imply that system is something okay for multi > > process, well, good luck. Daft. C/C++ has no std way to deal with > > multi process. But, we can use C/C++ to program for it all day > > long. Interesting.
> > There are, of course, languages and runtime systems that handle > processes too. An obvious example is Python. But it does it using a > significantly "thicker" abstraction layer, combined with a > significant run-time system to manage it all. And as a programmer, > you have to be aware that you can't access global data from different > processes, in the way you can do from different threads - you can > only use data that is explicitly shared, or of appropriate data > structures (like the process-aware queues). Behind the scenes, there > is a lot of work to pass and synchronise all this using named pipes, > memmapped shared files, etc. While C++ programmers are used to there > being a certain degree of "hidden work" (unlike in C, where work is > much more explicit), this kind of thing is not at all a match for the > C++ philosophy. > > And there are languages like Erlang that divide everything into > micro-processes, and use the same mechanisms for controlling and > passing data around regardless of whether this little processes are > in the same thread, or different threads, different OS processes, or > different computers. That works because there are very narrow and > tightly controlled mechanisms for sharing data. > > Note that these are both languages that run on a VM, not compiled > languages. >
What you wrote about Erlang resembles MPI, which of course is readily available for many compiled or jitted languages, including Fortran, C and C++. I tried to utilize MPI 20 years ago, but the thinking behind it is to different from mine, so I ran away in horror.