C++ Logo

std-discussion

Advanced search

Re: Recording thread_local variable initialization order for destruction

From: Thiago Macieira <thiago_at_[hidden]>
Date: Wed, 15 Apr 2020 09:02:35 -0300
On Wednesday, 4 March 2020 10:14:35 -03 Florian Weimer via Std-Discussion
wrote:
> What's the reason that this requirement was put into the standard?
> Destruction order of singletons is tricky, and the suggested order does
> not work in all cases. (If I recall correctly, Andrei Alexandrescu
> discusses the surrounding issues extensively in Modern C++ Design, in
> the context of regular, non-thread-local singletons.)

My guess is that no one thought that the requirement would be especially
cumbersome, as dlopen does not exist in the standard. The requirement is the
same as for regular ol' static variables.

-- 
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
   Software Architect - Intel System Software Products

Received on 2020-04-15 07:05:38