hello.
My problem is, I have block matrix updated by multiple threads. Multiple threads may be updating disjoint block at a time but in general there may be race conditions. right now matrix is locked using single lock.
The question is, is it possible (and if it is, how?) to implement an efficient array of locks, so that only portions of matrix maybe locked at a time.
The matrix in question can get rather large, on order of 50^2 blocks. my initial guess is to use dynamically allocate vector/map of mutexes.
Is it good approach? is it better to use multiple condition variables instead? is there better approach?
Thank you