Skip to content

Threadpool create/destroy deadlock [BUG] #107

@alugowski

Description

@alugowski

Simple reproducible deadlock:

#include <iostream>
#include "BS_thread_pool_light.hpp"

void func() {
  BS::thread_pool_light pool;
  pool.wait_for_tasks();
}

int main() {
  for (int i = 0; i < 1e6; ++i) {
    func();
    std::cout << i << " ";
    std::cout.flush();
  }
  std::cout << "done" << std::endl;
  return 0;
}

Sometimes this deadlocks at iteration 100, sometimes 5000, but it always does.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions