On 10/25/2026 9:29 AM, bolt…@caprica.universe wrote:
> On Sun, 25 Oct 2026 16:15:21 -0000 (UTC)
> cro…@spitfire.i.gajendra.net (Dan Cross) gabbled:
>> In article <YHpD…@fx39.iad>,
>> Scott Lurndal <slp…@pacbell.net> wrote:
>>> cro…@spitfire.i.gajendra.net (Dan Cross) writes:
>>>> In article <2026…@yahoo.com>,
>>>> Michael S <alre…@yahoo.com> wrote:
>>> <snip>
>>>>> How any of this trivia has anything to do with real-world
>>>>> implementations of C++11 threads?
>>>>
>>>> Your statement, "while in theory threads can be implemented by
>>>> C++ compilers+language support library, in practice I had never
>>>> seen it done" is probably strictly true: you, individually, have
>>>> never seen it done.
>>>>
>>>> But that does not imply that it has never been done. In
>>>> fact, it has; many times over. There are complications, but it
>>>> can be done. That is what I was telling you, supported by
>>>> examples.
>>>
>>> Although it does, generally, rely on specific operating system
>>> interfaces (e.g. makecontext, setcontext, et alia).
>>
>> That's true. But no one said that one can use strict ISO C++ to
>> implement the C++ standard library.
>>
>> Regardless, if you can set the stack pointer, you can build a
>> reasonable cooperative threading library purely in userspace,
>> without the OS caring.
>
> Oh really? You seem to have forgotten about the program counter not to
> mentioning pushing and popping all the other cpu registers and flags at context
> switch.
>
Make Fibers in 100% pure C++? But those are not threads. Multiple fibers can run on a single thread. Although, I think they can run on multiple threads as well. So, multiple threads, multiple fibers per thread.