vector<thread> threads(numThreads);
BENCHMARK_SUSPEND {
- for (int t = 0; t < numThreads; ++t) {
+ for (size_t t = 0; t < numThreads; ++t) {
threads[t] = DSched::thread([&, t, numThreads] {
Lock privateLock;
Lock* lock = useSeparateLocks ? &privateLock : &globalLock;
vector<thread> threads(numThreads);
BENCHMARK_SUSPEND {
- for (int t = 0; t < numThreads; ++t) {
+ for (size_t t = 0; t < numThreads; ++t) {
threads[t] = DSched::thread([&, t, numThreads] {
struct drand48_data buffer;
srand48_r(t, &buffer);
vector<thread> threads(numThreads);
BENCHMARK_SUSPEND {
- for (int t = 0; t < numThreads; ++t) {
+ for (size_t t = 0; t < numThreads; ++t) {
threads[t] = DSched::thread([&, t, numThreads] {
struct drand48_data buffer;
srand48_r(t, &buffer);
vector<thread> threads(numSendingThreads + numReceivingThreads);
BENCHMARK_SUSPEND {
- for (int t = 0; t < threads.size(); ++t) {
+ for (size_t t = 0; t < threads.size(); ++t) {
threads[t] = DSched::thread([&, t, numSendingThreads] {
if (t >= numSendingThreads) {
// we're a receiver
while (!goPtr->load()) {
this_thread::yield();
}
- for (int i = 0; i < numRounds; ++i) {
+ for (size_t i = 0; i < numRounds; ++i) {
locks[i % 3].first.unlock();
locks[(i + 2) % 3].first.lock();
burn(burnCount);
while (!goPtr->load()) {
this_thread::yield();
}
- for (int i = 0; i < numRounds; ++i) {
+ for (size_t i = 0; i < numRounds; ++i) {
locks[i % 3].first.lock_shared();
burn(burnCount);
locks[(i + 2) % 3].first.unlock_shared();
};
auto ctx = std::make_shared<CollectNContext>();
- if (std::distance(first, last) < n) {
+ if (size_t(std::distance(first, last)) < n) {
ctx->p.setException(std::runtime_error("Not enough futures"));
} else {
// for each completed Future, increase count and add to vector, until we