How do I make an array shared among all threads such that many threads are working on it and all are

Providing small snippets for the same will be of much help.