C++ Logo

STD-DISCUSSION

Advanced search

Subject: Re: Recording thread_local variable initialization order for destruction
From: Thiago Macieira (thiago_at_[hidden])
Date: 2020-04-15 07:02:35


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

STD-DISCUSSION list run by std-discussion-owner@lists.isocpp.org

Older Archives on Google Groups