On Friday, 13 May 2022 at 18:23:58 UTC, H. S. Teoh wrote:
On Thu, May 12, 2022 at 11:45:47PM +0000, Guillaume Piolat via
It's a problem because it goes from solving "no accidental race condition" and you get "people forget to add shared or __gshared and their shared library silently fail" situation. You could have none of that with explicit TLS.

Valid point.

Yeah, I used to be pro-TLS by default, then got bit by it several times and moved to the fence, and now I'm anti.

Data races aren't actually prevented by it (maybe forcing you to specify shared or tls would at least get you think about it though) and lots of things mysteriously fail if you forget about it.

You can lock the variable and everything and it still null cuz it was tls the whole time. Oops.

This a case where I think forcing explitness would be better than either default, but failing that, tls by default is the more-bad choice.

Reply via email to