Skip to content

Commit

Permalink
Only have a threadpool the size of the allowable cores, not all of them
Browse files Browse the repository at this point in the history
  • Loading branch information
khuck committed Feb 7, 2024
1 parent 7d5f067 commit 81935f4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/apex/threadpool.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,14 @@
#include <functional>
#include <mutex>
#include <condition_variable>
#include "utils.hpp"

namespace apex {
namespace treemerge {

class ThreadPool {
public:
ThreadPool(uint32_t size = std::thread::hardware_concurrency()) :
ThreadPool(uint32_t size = my_hardware_concurrency()) :
nthreads(size) {};
void Start(void);
void QueueJob(const std::function<void()>& job);
Expand Down
3 changes: 2 additions & 1 deletion src/apex/tree.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@ class node {
return children.at(cname);
}
static node * buildTree(std::vector<std::vector<std::string>>& rows, node * root);
static size_t getSize() { return count; }
static size_t getSize(void) { return count; }
static void reset(void) { count = 0; }
};

} // namespace treemerge
Expand Down

0 comments on commit 81935f4

Please sign in to comment.