[Info-vax] writing a lock free linked list

Joshua Lehrer usenet_vms at lehrerfamily.com
Sun Oct 4 17:48:34 EDT 2009


Okay.  I understand what a memory barrier is, and I understand the
trivial example of when you need them:

g_global1=x;
mb();
g_global2=y;

My question is, if my only access to a global is confirmed via calls
to cmp_swap_quad, do I need a memory barrier in addition?

e.g.
x=global;
__cmp_swap_quad(&global,x,y);

Likewise, if I use atomic operations, like atomic_increment, do I need
a memory barrier before/after?

atomic_increment_long(&x);
atomic_increment_long(&y);

is it possible that y is seen as incremented on another processor
before x?

Thanks,

j



More information about the Info-vax mailing list