Working on something where I need to be at least somewhat thread-safe internally. I have one "big" class which houses several smaller objects. Each individual small object needs a mutex. The thing is... there might be hundreds or thousands of small objects.
So my question is:
If I give all these small objects their own mutex, would that be bad for performance? Is there a lot of overhead in creating/destroying mutexes?
An alternative would be to have all the small objects share the mutex of the larger object... which is not ideal.
I haven't been able to find any information directly on point in google.