[OT] .net is getting slices

via Digitalmars-d digitalmars-d at puremagic.com
Fri Jul 14 05:25:47 PDT 2017


On Friday, 14 July 2017 at 10:44:36 UTC, Kagamin wrote:
> On Friday, 14 July 2017 at 06:05:42 UTC, Petar Kirov 
> [ZombineDev] wrote:
>> the inability to use atomic instructions to update it
>> concurrently
>
> That's a problem for D too.

core.atomic supports 2 * (void*).sizeof atomicLoad, atomicStore 
and cas (compare-and-swap) on platforms that support it (x86 and 
x86_64 for sure, and for others you have to check what libatomic 
(GCC) and llvm do).
Rereading the article again I noticed that they use the horrid 
Pointer + Offset + Length representation only for old runtimes, 
but use Pointer + Length for new ones.
Regardless of that, the only value-types that you perform atomic 
operations in .NET are int, long, IntPtr, float and double - see 
https://docs.microsoft.com/en-us/dotnet/api/system.threading.interlocked?view=netframework-4.7.


More information about the Digitalmars-d mailing list