Hello, FROHNER!
You wrote to <log...@li...> on Thu, 25 Sep 2008
16:53:07 +0300:
FA> We are using log4cpp in our project and we have some multi-threaded
FA> services. Hence we are very happy with the thread safety improvements
FA> of v1.0, however there are still a few areas, where static variables
FA> are used without explicit locking:
FA> AppendersFactory& AppendersFactory::getInstance()
FA> LayoutsFactory& LayoutsFactory::getInstance()
FA> TriggeringEventEvaluatorFactory&
TriggeringEventEvaluatorFactory::getInstance()
FA> Could they not cause any problem if they are ran in a multi-threaded
FA> environment, where the statements might interleave?
Hm.... Yes, they definitly will cause race problems if they run in
concurence. If you make any concurent call to AppendersFactory,
LayoutsFactory or TriggeringEventEvaluatorFactory you will hit a race
condition. The only reason why this part is not protected by mutex is that I
have never configure/reconfigure log4cpp in multi-thread enviroment. We
configure first, than run threads. If you do the same, than you will not
have any problems.
Anyway I will address this issue in main line soon.
With best regards, Konstantin Litvinenko.
|