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
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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