On 10/25/2026 2:45 AM, David Brown wrote:
> On 25/10/2026 00:11, Michael S wrote:
>> On Sat, 24 Oct 2026 21:24:58 -0000 (UTC)
>> cro…@spitfire.i.gajendra.net (Dan Cross) wrote:
>>
>>> In article <11bj…@dont-email.me>,
>>> Peter Flass <Pet…@Iron-Spring.com> wrote:
>>>> On 10/24/26 09:41, Dan Cross wrote:
>>>>> In article <11bh…@dont-email.me>,
>>>>> <bolt…@caprica.universe> wrote:
>>>>>> On Fri, 23 Oct 2026 20:45:27 -0000 (UTC)
>>>>>> cro…@spitfire.i.gajendra.net (Dan Cross) gabbled:
>>>>>>> In article <11bf…@dont-email.me>,
>>>>>>> <bolt…@caprica.universe> wrote:
>>>>>>>> On Thu, 22 Oct 2026 16:22:30 -0000 (UTC)
>>>>>>>> cro…@spitfire.i.gajendra.net (Dan Cross) gabbled:
>>>>>>>>> In article <11bd…@dont-email.me>,
>>>>>>>>> <bolt…@battlestar.co.uk> wrote:
>>>>>>>>>> You need an OS to do threading properly too. Theres a reason
>>>>>>>>>> green threads in java were a joke.
>>>>>>>>>
>>>>>>>>> Weird that you think you need a operating system for threads,
>>>>>>>>> yet you want C to standardize processes which also ... need an
>>>>>>>>> operating system. I mean, POSIX already does an ok job of
>>>>>>>>> standardizing the sorts of process-y things you would expect
>>>>>>>>> from, you know, an operating system.
>>>>>>>>
>>>>>>>> I'm simply pointing out the inconsistency in having a threading
>>>>>>>> library but not a process library. Its perfectly possible to
>>>>>>>> simulate a multiprocess enviroment.
>>>>>>>
>>>>>>> So write a simulator in your language of choice. You don't need
>>>>>>> the language to standardize a process model for that.
>>>>>>
>>>>>> Ditto threads. So why does C++ have a threading library?
>>>>>>
>>>>>> Take your time...
>>>>>
>>>>> What, pray tell, do you think that a _thread_ is? And how is it
>>>>> different from a _process_? For that matter, what do you think
>>>>> that a _process_ is?
>>>>>
>>>>> Please, take all the time you need to answer.
>>>>
>>>> Threads share resources such as address space, files, etc. A process
>>>> runs in its own address space. (at least these days, before virtual
>>>> memory, who knows?)
>>>
>>> Indeed, but I'm hoping Mr Boltar will chime in with his answers,
>>> so that we can understand why thinks that a language like C
>>> should introduce a *process* model, and how threads are similar.
>>>
>>> - Dan C.
>>>
>>
>> First, he was talking about C++. Unlike me, he does not appear to care
>> about C.
>> Second, while in theory threads can be implemented by C++
>> compilers+language support library, in practice I had never seen it
>> done. All I had seen is C++ threads implemented in library as thin
>> wrapper atop of the OS (or RT executive) implementation.
>> I can not see while the same can't be done for processes, with
>> API modeled on posix_spawn() or Windows CreateProcess().
>> It does not look like variety in this field is bigger than in case of
>> threads. More like it is smaller.
>>
>
> 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.