vendredi 3 avril 2015

Passing arrays to thread

I am trying to pass multiple arrays to threads that are created using std::thread as follow:



threadPool.push_back(std::thread(factor, Ap, Ai, Ax, b, Rs, Q, P, Pinv, n, 0, n, scale, nz));


and the function factor is defined as the following:



void factor(int Ap[], int Ai[], double Ax[], double b[], double *Rs, int *Q, int *P, int *Pinv, int n, int k1, int k2, int scale, int nz);


The thread is created successfully and I can see it in the visual studio threads window (from the debugger). However, the data of the arrays in the thread are not similar to the data sent to the thread. Any one has any idea what could be the reason ?


Aucun commentaire:

Enregistrer un commentaire