Re: InterlockedIncrement, InterlockedCompareExchange, etc

2016-08-28 Thread Lodovico Giaretta via Digitalmars-d-learn
On Sunday, 28 August 2016 at 21:52:48 UTC, Illuminati wrote: The interlocked functions generate memory barriers, does atomicOp do that? Also D doesn't seem to have a volitile keyword anymore which is required to prevent the compiler from prematurely optimizing critical code. I'm under the

Re: InterlockedIncrement, InterlockedCompareExchange, etc

2016-08-28 Thread David Nadlinger via Digitalmars-d-learn
On Sunday, 28 August 2016 at 21:52:48 UTC, Illuminati wrote: Also D doesn't seem to have a volitile keyword anymore which is required to prevent the compiler from prematurely optimizing critical code. It isn't. In fact, using volatile to achieve thread synchronisation (seeing as this is what

Re: InterlockedIncrement, InterlockedCompareExchange, etc

2016-08-28 Thread Illuminati via Digitalmars-d-learn
On Sunday, 28 August 2016 at 20:38:30 UTC, Lodovico Giaretta wrote: On Sunday, 28 August 2016 at 19:53:51 UTC, Illuminati wrote: What are the D equivalents to these types of functions? I do not see anything in core.atomic that can accomplish this. I have tried to include

Re: InterlockedIncrement, InterlockedCompareExchange, etc

2016-08-28 Thread Jack Applegame via Digitalmars-d-learn
On Sunday, 28 August 2016 at 20:38:30 UTC, Lodovico Giaretta wrote: On Sunday, 28 August 2016 at 19:53:51 UTC, Illuminati wrote: What are the D equivalents to these types of functions? I do not see anything in core.atomic that can accomplish this. I have tried to include

Re: InterlockedIncrement, InterlockedCompareExchange, etc

2016-08-28 Thread Lodovico Giaretta via Digitalmars-d-learn
On Sunday, 28 August 2016 at 19:53:51 UTC, Illuminati wrote: What are the D equivalents to these types of functions? I do not see anything in core.atomic that can accomplish this. I have tried to include core.sys.windows.winbase but still get linker errors(I've also directly tried importing

InterlockedIncrement, InterlockedCompareExchange, etc

2016-08-28 Thread Illuminati via Digitalmars-d-learn
What are the D equivalents to these types of functions? I do not see anything in core.atomic that can accomplish this. I have tried to include core.sys.windows.winbase but still get linker errors(I've also directly tried importing kernel32 using various methods and still nothing). Regardless,