heinrichmartin - 2008-04-14

Logged In: YES
user_id=2029746
Originator: NO

a simple but quite expensive workaround would be to release any NDC whenever it becomes empty:

std::string NDC::_pop() {
std::string result = _stack.back().message;
_stack.pop_back();
if (_stack.empty()) _nDC.reset(); // I have successfully tested this for MSThrads
return result;
}

of course the real extra cost depends very much on how NDC is going to be used (e.g. is there always a initial context for every thread). A compiler switch would be nice for that. Else every thread must call an explicit release which does not yet exist...

greets,
heinrichmartin