Few weeks ago i coded a Arithmetic algorithm and now I´m trying to increase the speed using threads. The problem im facing is to pass the function to the thread. This is what i have for now.
This is the class where i have the function to encode.
class ModelI
{
public:
ModelI();
void Process(fstream *source, fstream *target, ModeE mode,int bits);
protected:
/*........*/
};
And here how I create the thread on the main
vector<thread> t;
ModelI* model = new ModelI;;
clock_t begin = clock();
for (int i = 0;i < 8;i++) {
t.push_back(thread(model->Process,ref(source),ref(target),MODE_ENCODE,bits));//---> Error here
THe error I get is: "No instance of constructor std::thread::thread" matches the argument list. What am i doing wrong?
Thanks.