Date: Fri, 03 Oct 2025 12:05:06 +0300
On Fri, 2025-10-03 at 01:24 +0000, Walt Karas via Std-Proposals wrote:
> On Thursday, October 2, 2025 at 06:21:33 PM EDT, Jeremy Rifkin via
> Std-Proposals <std-proposals_at_[hidden]> wrote:
>
> Hi,
>
> What's the motivation for non-static thread-local class members?
>
> What's the motivation for restricting an instance of a class to have
> static storage duration?
>
> Answer: Class versus per-instance member variable seems fully
> orthogonal to shared-by-all-threads versus thread-local, logically
> speaking. But a lot of complex scenarios arise if the thread lifetime
> is not contained within the lifetime an object that has thread_local
> variables as non-static members. Only allowing per-instance
> thread_local member variables avoids that complexity.
If it was truly orthogonal, then you could have non-static instances of
this class that has non-static thread-local variables.
> On Thursday, October 2, 2025 at 06:21:33 PM EDT, Jeremy Rifkin via
> Std-Proposals <std-proposals_at_[hidden]> wrote:
>
> Hi,
>
> What's the motivation for non-static thread-local class members?
>
> What's the motivation for restricting an instance of a class to have
> static storage duration?
>
> Answer: Class versus per-instance member variable seems fully
> orthogonal to shared-by-all-threads versus thread-local, logically
> speaking. But a lot of complex scenarios arise if the thread lifetime
> is not contained within the lifetime an object that has thread_local
> variables as non-static members. Only allowing per-instance
> thread_local member variables avoids that complexity.
If it was truly orthogonal, then you could have non-static instances of
this class that has non-static thread-local variables.
Received on 2025-10-03 09:05:13