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

What i find even more weird is writing fast code is ugly in D

Look at this ugly code

```D
__gshared int fast_code_ugly;
```

It should be the opposite

Slow code ugly
Fast code beautiful

What can be done about it?

Renaming ``__gshared``

``shared`` is even more ugly since everything must be shared afterwards

I would have prefered if i had to manually set things to tls

```D
@tls int slow_code_ugly;
```

Even C does it better: https://gcc.gnu.org/onlinedocs/gcc/Thread-Local.html


  • Why are globals ... ryuukk_ via Digitalmars-d-learn

Reply via email to