I'm loading a folder full of DICOM and I'd like to do it multi-threaded. My program works for one thread but crashes for multiple threads. I have compiled with DCMTK_WITH_THREADS macro.
I am using DcmFileFormat and then DcmItem etc to parse. I believe these classes will work multi threaded - but obviously not same instance shared between threads.
The place it seems to crash (MSVC break point on unhandled exception) is on the line:
Code: Select all
bool
Logger::isEnabledFor (LogLevel ll) const
{
return value->isEnabledFor (ll); //value is null for some reason
}
For the moment I have removed all logging in oflog.h by redefining :
Code: Select all
#define OFLOG_TRACE(logger, msg)
#define OFLOG_DEBUG(logger, msg)
#define OFLOG_INFO(logger, msg)
#define OFLOG_WARN(logger, msg)
#define OFLOG_ERROR(logger, msg)
#define OFLOG_FATAL(logger, msg)
P.S. have you considered using BOOST or Poco utility libraries? It would add to the requirements when compiling DCMTK, but they do provide cross platform threading, synchronization (mutex), networking, logging (Poco). I really do wish for a nice thread support for DIMSE - StoreSCP, FindSCU etc etc.