Add instrumentation to root, add capability to forward to siblings if no path is known to a peer.

This commit is contained in:
Adam Ierymenko 2019-09-03 12:21:57 -07:00
parent 2e7496130c
commit fd6e8d8c5c
No known key found for this signature in database
GPG key ID: C8877CF2D7A5D7F3
4 changed files with 437 additions and 110 deletions

View file

@ -756,6 +756,24 @@ static int testOther()
char buf2[4096];
char buf3[1024];
std::cout << "[other] Testing Mutex and threads... "; std::cout.flush();
volatile unsigned long mcnt = 0;
Mutex mlock;
std::vector<std::thread> mthr;
for(int t=0;t<128;++t) {
mthr.emplace_back(std::thread([&mcnt,&mlock]() {
for(int i=0;i<10000;++i) {
mlock.lock();
++mcnt;
mlock.unlock();
usleep(1);
}
}));
}
for(std::vector<std::thread>::iterator t(mthr.begin());t!=mthr.end();++t)
t->join();
std::cout << "OK (" << mcnt << ")" ZT_EOL_S;
std::cout << "[other] Testing bit counting functions... "; std::cout.flush();
uint32_t i32 = 0;
uint64_t i64 = 0;