Threads in global functions, write on shared memory

Hi!

I have some easy questions about CUDA.

in global functions: how do threads behave? does every thread run through the function on its own, just waiting for the other threads at __syncthreads()?

concerning variables in shared/global memory:
I have all the threads in a block adding a value to the same variable which resides in shared memory. is there any problem about it when the threads write at the same time? or do they just wait, until the variable is “free”?
same problem with global memory: threads from different blocks shall write on one variable residing in global memory. could there be any problem?

regards,
Ledernacken