On 01/16/2011 07:40 AM, Peter Kümmel wrote:
Attached a patch which introduces a value semantic for the Converter list. theConverters now doesn't return a reference any more but a copy of the list.
This way we could remove the locks in Graph.cpp.

The returned Converters is const, so the compiler shows up the places where we touch the converter list where a other function must be called to get a
reference.

This way we get much more const correctness!

Maybe the mutual in Graph.h isn't perfect, but the implementation of Graph also changes internal variable even when a in principle const function is called.

mutable?

But I'm not sure if this patch is more expensive than the locks in Graph.cpp,
and we have to introduce more such changes on all global lists.

This would be less expensive if we were able to cache answers, as I suggested in the other message.

Richard

Reply via email to