Accessing global memory

Is it possible to have different work-items (on different work-groups) writing to a global variable in a synchronized way? Does it make sense, by the way? I was thinking on calculating the sum of all positions of an array for example…

Look at atomics, if your hardware supports the extensions. Also consider local atomics, if on a 1.3 device. See Spec sections 9.5 - 9.7