Prime sieve language race

Sebastiaan Koppe mail at skoppe.eu
Thu Jul 15 13:10:44 UTC 2021


On Wednesday, 14 July 2021 at 20:45:05 UTC, ag0aep6g wrote:
> On Wednesday, 14 July 2021 at 19:10:55 UTC, Sebastiaan Koppe 
> wrote:
>> Because member functions are harder to call from multiple 
>> threads than static functions are. For one, you will have to 
>> get the object on two threads first. Most functions that do 
>> that require a shared object, which requires a diligent 
>> programmer to do the casting.
>
> The object isn't necessarily the thing that is being shared. A 
> method can be accessing some `__gshared` global just like a 
> static function can.

Of course, there is always a loophole somewhere.

But does that all imply that we have to make all non-threadsafe 
functions @system? How can we every be @safe?


More information about the Digitalmars-d mailing list