
3 Jan
2005
3 Jan
'05
6:13 a.m.
Don G wrote:
I was reading the shared_ptr and shared_count classes and noticed that a mutex is used when it appears that atomic inc/dec could be used instead. Unless I am missing something? The atomic operations would be far better in terms of resource usage. It seems (to me anyway) far too expensive to have a mutex allocated for every object under management.
Here are some recent threads in which this was discussed. http://lists.boost.org/MailArchives/boost/msg02402.php http://lists.boost.org/MailArchives/boost/msg76317.php http://lists.boost.org/MailArchives/boost/msg71834.php Jonathan