Index-dependent lock/mutex mechanism for synchronization
===

Let's say I have an array (of fixed size) that is shared between multiple threads/processes. 

Is there a (generalized, optimally lightweight) mechanism for a lock/mutex so that I don't have to lock access to the entire array if I just want to read/write from a certain position in the array?

A brute force approach would be to simply have one mutex for each element in the array. However, this seems a bit overweight and I'm looking for alternative solutions.