I think you might actually want two memory barriers, something like

MemoryBarrier();
*ptr = value;
MemoryBarrier();

your current solution prevents compiler reordering the store with
statements after, but what about statements before?


On Thu, Jan 23, 2014 at 11:20 AM, <[email protected]> wrote:

>
> Comment #1 on issue 599 by [email protected]: Fails to compile for Intel Phi
> http://code.google.com/p/protobuf/issues/detail?id=599
>
> Thanks Stephen. ICC supports GCC's inline assembly syntax. I've applied
> your suggestion and tested it. An updated patch is attached.
>
> /peter
>
>
> Attachments:
>         atomicops_internals_x86_gcc.h.patch  658 bytes
>
>
> --
> You received this message because this project is configured to send all
> issue notifications to this address.
> You may adjust your notification preferences at:
> https://code.google.com/hosting/settings
>
> --
> You received this message because you are subscribed to the Google Groups
> "Protocol Buffers" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/protobuf.
> For more options, visit https://groups.google.com/groups/opt_out.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to