RE: [Boost-users] Re: shared_ptr: LWM versus atomic_count?

Russell Hind
Ben Hutchings wrote:
It isn't fundamentally necessary to have two counters, though; see <http://groups.google.com/groups?threadm=slrnbhbnpc.154.do-not-spam -benh%40tin.bwsint.com>.
I'd seen this (I think you posted the same link recently). I don't know if anything has been done to change the implementation of shared_ptr to use this method, though (nothing to do with me).
The difficulty is that it depends on a couple of unportable atomic functions that can't be implemented using the existing contents of Boost.Threads or pthreads (though they do translate neatly into Win32 functions).
If the speed increases mentioned are correct, then it certinaly seems a good proposal.
Well maybe I'll have a go at implementing it properly and then trying to get it into Boost. I suppose it can be selectively enabled for those platforms that support it.
participants (1)
-
Ben Hutchings