Project

General

Profile

Patch #810 » main.cpp

Test program that demonstrates the patch - Marco Eichelberg, 2018-01-29 16:12

 
#include <iostream>
#include <list>
#include <thread>
#include <dcmtk/dcmdata/dcdeftag.h>
#include <dcmtk/dcmdata/dcdicdir.h>

void test()
{
for (unsigned int i = 0; i < 100000; ++i)
{
const DcmTag tag(DCM_AccessionNumber);
tag.getVR();
}
}

int main (int argc, char** argv)
{
const unsigned int numberOfThreads = 50;
std::list<std::thread> threads;
for (unsigned int i = 0; i < numberOfThreads; ++i)
threads.push_back(std::thread(test));
for (std::thread& thread: threads)
thread.join();
return EXIT_SUCCESS;
}
(2-2/2)