Hacker News new | ask | show | jobs
by lokar 334 days ago
The call to init should be idempotent
1 comments

That can be difficult in a multi-threaded environment with dynamically loaded shared libraries. Or at least it isn’t something that’s generally expected to be guaranteed to work.
C++ "magic statics" handle that use case (but with hidden atomic flag load (& more) costs at each access)
Ideally they would do the explicit init at startup before starting threads