DMD 0.170 release
Sean Kelly
sean at f4.ca
Thu Oct 19 10:42:34 PDT 2006
Bruno Medeiros wrote:
>
> Here's an idea:
>
> foreach(foo, aggregate) { // Unordered, so compiler may optmize
> foreach(foo, &aggregate.iterForward) { // Ordered and strict
> foreach(foo, &aggregate.iterReverse) { // Ordered and strict
>
> This way the strictness cannot be specified. Is it necessary? That is,
> is there a case where one wants an *ordered* iteration, but the compiler
> can optimize into an unordered (parallel) iteration?
If the involved data is volatile and being monitored by another thread,
then yes. But in that case some sort of memory barriers would probably
be involved and the compiler could detect those and not optimize, so I'm
not sure.
Sean
More information about the Digitalmars-d-announce
mailing list