1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-08-01 06:46:55 +03:00

MCOL-513 use a single funcor per thread. ThreadPool was doing one at a time anyway, but in a convpluted way that made it easier to add more if wanted. But it was expensive. Cleanup and polish.

This commit is contained in:
David Hall
2017-02-17 09:44:32 -06:00
parent 776add46dc
commit 87a679e6eb
13 changed files with 305 additions and 296 deletions

View File

@ -24,7 +24,7 @@ using namespace std;
using namespace joblist;
using namespace messageqcpp;
threadpool::ThreadPool FEMsgHandler::threadPool(100,200);
threadpool::ThreadPool FEMsgHandler::threadPool(50,100);
namespace {
@ -52,15 +52,14 @@ FEMsgHandler::FEMsgHandler(boost::shared_ptr<JobList> j, IOSocket *s) :
FEMsgHandler::~FEMsgHandler()
{
stop();
// thr.join();
boost::unique_lock<boost::mutex> lk(joinMutex);
threadPool.join(thr);
}
void FEMsgHandler::start()
{
if (!running) {
running = true;
threadPool.invoke(Runner(this));
thr = threadPool.invoke(Runner(this));
}
}
@ -109,7 +108,6 @@ bool FEMsgHandler::aborted()
void FEMsgHandler::threadFcn()
{
int err = 0;
boost::unique_lock<boost::mutex> lk(joinMutex);
int connectionNum = sock->getConnectionNum();
/* This waits for the next readable event on sock. An abort is signaled