Shared memory access of many threads

Hi all,

I have a qusetion about shared memory usage. If I define a variable to shared memory; does it mean that all threads of the block will access this variable, with the value that is defined by the first thread? Or does each thread define its own variable?

each thread in the block can read & write the shared memory.
the variable value will equal that the last thread writes…

Thanks, that makes it clearer and I think I found the reason for my different results… :)