如何访问 runner 函数的 main () 中动态声明的变量和矩阵。我将它们作为参数传递给 runner 但我不确定它是否正确,因为我必须在 pthread_create 函数调用中传递 runner。在将其传递给 runner 时,我是否必须提供我在 runner 中传递的所有参数?我该怎么做 ?
main() {
int m, n, p, q
int **a, **b, **c;
... // dynamically allocating first, second and multiply matrices and taking values
// m , n , p , q from user or a file.
...
r= pthread_create(threads[i], NULL, runner, (void*) &rows[i]);} // should I specify the
// parameters of runner in it ?
void *runner (int **a, int **b, int **c, int m, int n, int p ) // is it right ???
{
.... using all parameters
pthread_exit(NULL);
}