I have filed/updated bugs for these two issues:

http://bugs.mitk.org/show_bug.cgi?id=17581 (new)
http://bugs.mitk.org/show_bug.cgi?id=12254 (updated)

- Taylor


On Fri, Mar 14, 2014 at 8:23 AM, Taylor Braun-Jones
<[email protected]>wrote:

> Hi Alfred,
>
> Thanks for the quick response!
>
> On Fri, Mar 14, 2014 at 5:15 AM, Alfred Franz 
> <[email protected]>wrote:
>
>> Hi Taylor,
>>
>> thanks for reporting that issue. There might be some thread safety
>> problems with the mbilog::BackendCout class which is used as dummy backend
>> when no other logging backend is available. However, in MITK usually the
>> MITK logging backend is used (class mitk::LoggingBackend, files mitkLog.h
>> and mitkLog.cpp in the core). This logging backend should be tread safe,
>> there even is a unit test to assure this (mitkLogTest.cpp).
>
>
> Thanks for the tip, I'll check out that backend. However, the thread
> safety issue I'm seeing is not with the backend itself, but with the
> supporting mbilog functions in mbilog.cpp.
>
>
>> When using the MITK workbench the mitk::LoggingBackend is registerd in
>> the plugin activator of org.mitk.core.services. Do you use the MITK
>> workbench, or do you have your own application?
>>
>
> I have my own application using MITK core and several modules (no plugins)
>
>>
>> If you register the backend by yourself I would propose to simply use the
>> static method
>>
>> mitk::LoggingBackend::Register()
>>
>
> Looking at this method, I can see it will be prone to similar
> threading/initialization issues because the mitkLogBackend static instance
> in mitkLog.cpp is not mutex protected.
>
>>
>> to register the MITK logging backend. Then you can use MITK_INFO,
>> MITK_WARN, etc. to log your messages.
>>
>
> Yep, I'm consistently using those MITK_* macros for all my logging.
>
>>
>> Anyway there are two possible bugs which we might want to file because of
>> your problems:
>>
>> 1. There are logging messages before registration of the MITK logging
>> backend in org.mitk.core.services which are not thread safe because of (2).
>>
>> 2. The backend mbilog::BackendCout is not thread safe.
>>
>
> Actually, as far as I can tell, mbilog::BackendCout seems to be fine in
> terms of thread safety. It's the three functions in mbilog.cpp that are
> missing necessary thread safety mechanisms:
>
> mbilog::RegisterBackend
> mbilog::UnregisterBackend
> mbilog::DistributeToBackends
>
> So the thread safety issue exists regardless of which backend is used.
>
> Best regards,
> Taylor
>
>
------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/13534_NeoTech
_______________________________________________
mitk-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mitk-users

Reply via email to