
12 Feb
2009
12 Feb
'09
6:23 p.m.
Alp Mestan wrote:
Wouldn't it be better to do scoped logging ? It would prevent from mixing data when doing some MT programs, it would solve the "open_record()" problem, etc. But in this case their would be a scoped_mutex on our log writing function. And then, the destructor would log everything, so that we would be able to put many informations on the log stream and then log them all.
Yes, that's a good idea. I have answered to Vicente on this. However, this will not solve weak record ordering in the multithreaded application, as you seem to imply. The log record does not hold any locks for performance reasons.