Using many mutex locks

Posted by hanno on Stack Overflow See other posts from Stack Overflow or by hanno
Published on 2010-05-05T12:52:08Z Indexed on 2010/05/05 13:18 UTC
Read the original article Hit count: 190

Filed under:
|
|
|

I have a large tree structure on which several threads are working at the same time. Ideally, I would like to have an individual mutex lock for each cell.

I looked at the definition of pthread_mutex_t in bits/pthreadtypes.h and it is fairly short, so the memory usage should not be an issue in my case.

However, is there any performance penalty when using many (let's say a few thousand) different pthread_mutex_ts for only 8 threads?

© Stack Overflow or respective owner

Related posts about pthreads

Related posts about linux