Add instrumentation to root, add capability to forward to siblings if no path is known to a peer.
This commit is contained in:
parent
2e7496130c
commit
fd6e8d8c5c
4 changed files with 437 additions and 110 deletions
18
selftest.cpp
18
selftest.cpp
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue