-
2D array of threads?
I have a 2D array of cells and I need each to run its own pthread.
I have examples where they have created an array of threads e.g. pthread_t tid[CONST]
and run each thread using a for loop.
But in order to know which cell in the 2D array each thread belongs to it would be simple to create a 2D array of threads. Each of these cells change variables in other cells so an index is key.
Is it possible to do something like:
pthread_t tid[CONST1][CONST2]
Thanks
-
Is pthread_t a data type? If so, you're allowed to make an array of them. If you're allowed to make an array of them, then you're allowed to make a multi-dimensional array of them. I guess you should have just tried it eh?
Quzah.
-