#include <iostream>
#include <cstdlib>
#include <thread>
#include <typeinfo>
#include <sys/time.h>
#include <boost/date_time/posix_time/posix_time.hpp>
#include <boost/test/unit_test.hpp>
#include "uhal/uhal.hpp"
#include "uhal/tests/definitions.hpp"
#include "uhal/tests/fixtures.hpp"
#include "uhal/tests/tools.hpp"
#include "uhal/log/log.hpp"
Go to the source code of this file.
|
void | uhal::tests::job_multiple (const std::string &connection, const std::string &id, const size_t timeout) |
|
| uhal::tests::UHAL_TESTS_DEFINE_CLIENT_TEST_CASES (MultithreadedTestSuite, multiple_hwinterfaces, DummyHardwareFixture, { std::vector< std::shared_ptr< std::thread > > jobs;for(size_t i=0;i!=N_THREADS;++i) { log(Warning(), ThisLocation(), ":", Integer(i));jobs.emplace_back(new std::thread(job_multiple, connectionFileURI, deviceId, timeout));} for(size_t i=0;i!=N_THREADS;++i) { log(Warning(), ThisLocation(), ":", Integer(i));jobs[i]->join();} log(Warning(), ThisLocation());}) void job_single(HwInterface &hw) |
|
| uhal::tests::UHAL_TESTS_DEFINE_CLIENT_TEST_CASES (MultithreadedTestSuite, single_hwinterface, DummyHardwareFixture, { for(size_t iter=0;iter!=N_ITERATIONS ;++iter) { HwInterface hw=getHwInterface();std::vector< std::shared_ptr< std::thread > > jobs;for(size_t i=0;i!=N_THREADS;++i) { jobs.emplace_back(new std::thread([&hw]() {job_single(hw);}));} for(size_t i=0;i!=N_THREADS;++i) { jobs[i]->join();} } }) void job_single_copied(HwInterface hw) |
|
◆ N_ITERATIONS
◆ N_SIZE
#define N_SIZE uint32_t(10*1024/4) |
◆ N_THREADS
◆ TIMEOUT_MULTIPLIER
#define TIMEOUT_MULTIPLIER 50 |