MXS-1754 Reintroduce maxscale::Worker
Worker is now the base class of all workers. It has a message queue and can be run in a thread of its own, or in the calling thread. Worker can not be used as such, but a concrete worker class must be derived from it. Currently there is only one concrete class RoutingWorker. There is some overlapping in functionality between Worker and RoutingWorker, as there is e.g. a need for broadcasting a message to all routing workers, but not to other workers. Currently other workers can not be created as the array for holding the pointers to the workers is exactly as large as there will be RoutingWorkers. That will be changed so that the maximum number of threads is hardwired to some ridiculous value such as 128. That's the first step in the path towards a situation where the number of worker threads can be changed at runtime.
This commit is contained in:
@ -34,7 +34,6 @@
|
||||
#include "internal/service.h"
|
||||
#include "internal/config_runtime.h"
|
||||
#include "internal/modules.h"
|
||||
#include "internal/worker.h"
|
||||
#include "internal/routingworker.hh"
|
||||
|
||||
using std::list;
|
||||
@ -128,7 +127,7 @@ bool Resource::matching_variable_path(const string& path, const string& target)
|
||||
char* end;
|
||||
int id = strtol(target.c_str(), &end, 10);
|
||||
|
||||
if (*end == '\0' && mxs_worker_get(id))
|
||||
if (*end == '\0' && mxs_rworker_get(id))
|
||||
{
|
||||
rval = true;
|
||||
}
|
||||
|
Reference in New Issue
Block a user