Significantly improved scanner performance (now have a dedicated pool of threads for scanning file metadata)

This commit is contained in:
emeric
2024-02-10 18:39:55 +01:00
parent de4a0cf583
commit 6b1fd9c841
5 changed files with 261 additions and 98 deletions
@@ -25,19 +25,18 @@
class IOContextRunner
{
public:
IOContextRunner(boost::asio::io_service& ioService, std::size_t threadCount);
~IOContextRunner();
public:
IOContextRunner(boost::asio::io_service& ioService, std::size_t threadCount);
~IOContextRunner();
IOContextRunner(const IOContextRunner&) = delete;
IOContextRunner(IOContextRunner&&) = delete;
IOContextRunner& operator=(const IOContextRunner&) = delete;
IOContextRunner& operator=(IOContextRunner&&) = delete;
void stop();
std::size_t getThreadCount() const;
void stop();
private:
IOContextRunner(const IOContextRunner&) = delete;
IOContextRunner& operator=(const IOContextRunner&) = delete;
private:
boost::asio::io_service& _ioService;
std::optional<boost::asio::io_service::work> _work;
std::vector<std::thread> _threads;
boost::asio::io_service& _ioService;
std::optional<boost::asio::io_service::work> _work;
std::vector<std::thread> _threads;
};