shared memory example

I am new to CUDA 2.3 and was wondering if someone out there could give me a quick code example using shared memory?
Also, I know shared memory can only be accessed by threads within a single block, so is there a way to allow for read/write access by all threads in all blocks without communication with host? Maybe a global memory access example?

Thank you in advance.

Have you taken a look at the CUDA Programming Guide and the CUDA Best Practices Guide? I think you’ll find them very helpful in answering these questions.