Disallow thread local concepts to allow fibers move between threads @notl

Sebastiaan Koppe mail at skoppe.eu
Sat Jun 15 13:07:18 UTC 2024


On Saturday, 15 June 2024 at 08:43:12 UTC, Richard (Rikki) Andrew 
Cattermole wrote:
> On 15/06/2024 8:50 AM, Sebastiaan Koppe wrote:
>> On Friday, 14 June 2024 at 17:30:27 UTC, Richard (Rikki) 
>> Andrew Cattermole wrote:
>>>
>>> Destroy!
>> 
>> Instead of introducing 3 new attributes I think its a lot 
>> better to make TLS @system instead.
>> 
>> TLS should be used sparingly anyway, so making its usage more 
>> difficult is a lot cheaper than extra attributes than make 
>> everything else harder.
>
> That doesn't help ``TaskLocal`` which is a fiber-local wrapper 
> in vibe.d, it should be stored in TLS.
>
> You end up needing a whitelist solution.

In your opening post you say fibers lost, which I agree with, but 
then proceed to propose 3 new attributes for a fiber library 
feature which is  essentially mimicking globals. Why would we 
want to make it easier to do the wrong thing?

Any use of global, thread or task local variable should raise 
eyebrows. Typically they are needed only in core libraries or 
runtimes.


More information about the dip.ideas mailing list