It sounds like a reasonable path.
There are a few things to consider, though:
You state that your idea is to have "many mutexes, each of which is responsible for a specific range in the array." You should probably consider access patterns to decide how to assign entries to mutexes. If streams will work with closed records, you can consider assigning records to mutexes using a different scheme, for example, a record index modulo the number of mutexes.
From experience, we note that the number of mutexes should be determined by the number of threads, and not by the size of the range. I wrote more about this in this question (this is an accepted answer, at the time of writing this).
Again, depending on the usage pattern, you should consider using read / write locks to avoid unnecessary serialization for multiple readers on the same record. YMMV.
source share