Converting from tango.Atomic to D2 core.atomic
Sean Kelly
sean at invisibleduck.org
Thu Jul 7 09:54:39 PDT 2011
1. The volatile statements should really be converted to atomic ops. I've been lazy about it because it works as-is.
2a. There is an atomicLoad and atomicStore in core.atomic. Not sure if it's in the current release though.
Sent from my iPhone
On Jul 6, 2011, at 11:45 AM, eris <jvburnes at gmail.com> wrote:
> Hi,
>
> I've been converting 'qtd' (the qt lib interface for D) to ldc / D2 version.
> Apparently some areas of the phobos and druntime library are still a little
> green for D2 or LDC2 because I'm jumping through some hoops to make it work.
>
> Minor Issues:
>
> 1. core.thread is still using 'volatile' instead of 'synchronized'. Volatile
> has been deprecated and you need to tell the compiler to ignore it or the
> compile fails. I'm thinking that a core D2 library should not cause a compile
> abort by default. I got passed it by disabling deprecated checks.
>
> Major Issues:
>
> 2. One file in the qtd implementation (QList.d) is using some sort of
> lock-free shared list. Their implementation uses the old tango.core.Atomic
> semantics of Atomic! (load, store, increment, decrement). I've tried
> converting these to the equivalent phobos core.atomic and running into some
> dead ends.
>
> a) core.atomic implements nearly all binary ops as well as nearly all
> assignment / increment ops. But it doesn't implement the simplest of the ops:
> load, store. Are these assumed to "just work" for ints and doubles? If so,
> fine, but there are platform-dependent gotchas lurking along that path.
>
More information about the Digitalmars-d
mailing list