In OpenCL, global memory consistency is only guaranteed at the start of a kernel invocations. So, if one work-item writes a value to global memory, you cannot guarantee that this new value will be visible to work-items that are in other work-groups. This new value will be visible to all work-items by the next kernel invocation however, which in your example would be the next iteration.
So, yes, the *i
value will be incremented by the next iteration's work-item 0, but no, you cannot share that value with other work-items within the same iteration (unless they are in the same work-group, in which case you need to use a barrier).
There's a more detailed description of the OpenCL memory model in the specification, which is worth a read to get a good handle on this stuff.