On 3/26/23 2:07 PM, ryuukk_ wrote:
Hi,

It's common knowledge that accessing tls global is slow http://david-grs.github.io/tls_performance_overhead_cost_linux/

What i do not understand is the reasoning behind choosing tls global by default in D

If you know a variable is not `shared`, then you know it can only be accessed from the current thread. This has huge implications for thread access.

However, one problem that D has no good solution is passing thread-local data to another thread (to be owned by the new thread, and no access in the current thread). That's typically the most common use case for "shared data".

-Steve

Reply via email to