我在使用_beginthreadex
. 如何将我制作的函数发送到线程?我对线程完全陌生,这是个愚蠢的问题,但我无法处理
//Function that I want to send to a thread
vector<int>F1(vector<int> A, vector<int> B, vector<int> C, vector<int> D, vector<vector<int>> MA, vector<vector<int>> MD) {
vector<int> ResVect;
ResVect = plusVector(plusVector(A, plusVector(B, C)), VectMultMatr(D, MultMatr(MA, MD)));
return ResVect;
}
//Thread funcF1
int main(){
HANDLE funcF1, funcF2, funcF3;
//////F1//////
cout << "Task 1 starts" << endl;
vector<int>A = createVect(1, 4);
vector<int>B = createVect(1, 4);
vector<int>C = createVect(1, 4);
vector<int>D = createVect(1, 4);
vector<vector<int>>MA = createMatrix(1, 4);
vector<vector<int>>MD = createMatrix(1, 4);
//vector<int>E = F1(A, B, C, D, MA, MD);
funcF1 = (HANDLE)_beginthreadex(0, 0, &F1(A, B, C, D, MA, MD), 0, 0, 0);
}