feat: increased thread count for pool
This commit is contained in:
		
							parent
							
								
									f393775fc8
								
							
						
					
					
						commit
						03da0b18e0
					
				| 
						 | 
					@ -4,7 +4,7 @@
 | 
				
			||||||
 | 
					
 | 
				
			||||||
namespace threading {
 | 
					namespace threading {
 | 
				
			||||||
ThreadPool::ThreadPool() {
 | 
					ThreadPool::ThreadPool() {
 | 
				
			||||||
	size_t const thread_count{ std::max(std::thread::hardware_concurrency() / 2, 1u) };
 | 
						size_t const thread_count{ std::max(std::thread::hardware_concurrency() - 1, 1u) };
 | 
				
			||||||
	this->threads.reserve(thread_count);
 | 
						this->threads.reserve(thread_count);
 | 
				
			||||||
	for (size_t i{ 0 }; i < thread_count; ++i) {
 | 
						for (size_t i{ 0 }; i < thread_count; ++i) {
 | 
				
			||||||
		this->threads.emplace_back(std::bind(&ThreadPool::ThreadFn, this));
 | 
							this->threads.emplace_back(std::bind(&ThreadPool::ThreadFn, this));
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in a new issue