Threads and all that is wrong with them
Okay, I've got an interesting problem...
I have a threaded program, and each thread has several variables that need to be passed into it. Several ints, a float or two, and a matrix. Now, I've gotten my struct built so that I can pass in all these very odd values:
struct thread_struct{
int rows;
int cols;
int sem_int;
float *matrix;
};
//Insert some code in here
float *t_matrix[i][j];
thread_struct *t_type;
(*t_type).cols=j;
(*t_type).rows=i;
(*t_type).sem_int=7;
(*t_type).matrix=(float*)t_matrix;
And then I pass the struct into my thread
pthread_create(&pde_t[0], NULL, t_proc, (void*)&t_type);
Now, my question is HOW do I retrieve all of my info once I get into my thread?
Thanks y'all.