Hi,
I am trying to do multithreading by
boost::bind
. But, I got error:
src/model.cpp:225: instantiated from here
/boost_1_45_0v/include/boost/bind/mem_fn.hpp:333: error: pointer to member type void (Model::)(taskDataSPType&)
incompatible with object type taskDataSPT1ype
make: * [model.o] Error 1
Here is my code:
void Model::runTask(taskDataSPType& myTask)
{}
taskDataSPType myTask;
fifo_pool tp(thread_num);
for (int i = 0 ; i < totalTaskNum ; +i)
{
taskQueue.wait_and_pop(myTask, i);
myTask.taskID = i ;
// run the typical iterations
tp.schedule(boost::bind(&Model::runTask, &myTask));
}
tp.wait();
In another header file, I have :
typedef struct taskDataSPT1ype taskDataSPType;
struct taskDataSPT1ype
{
int taskID;
int startNode;
int endNode;
};