logoalt Hacker News

gpderetta11/07/20241 replyview on HN

It is hard to take seriously someone that claims that thread locals are a toxic addition to the standard. (incidentally __thread is a GCC extension that predates the standard by almost a decade).


Replies

sylware11/08/2024

This little keyword makes the compiler generates calls to the system threading libs (libpthread), or even worse, declare a TLS slot in the ELF format, which is a limited resource (you cannot reasonably resize the TLS segment on the fly).

Yes, that amount of complexity is obviously toxic... and saying otherwise is what will make you hard to be taken seriously, come on dude...