#include #include #include #define N 16384 #define MT 64 unsigned long int data[N]; typedef struct { int sec; int size; unsigned long int *start; float sum; } param; void* new_thread(void* arg) { unsigned long int i; printf("t: %d %d %lu\n", ((param *)arg)->sec, ((param *)arg)->size, ((param *)arg)->start[0]); ((param *)arg)->sum=0.0; for (i=0; i<((param *)arg)->size; i++) ((param *)arg)->sum += (float) ((param *)arg)->start[i]; return(NULL); } int main(int argc, char **argv) { int nt=1; unsigned long int i=1; pthread_t tid[MT]; param p[MT]; float sum, total; if ( argc > 1 ) nt=atoi(argv[1]); for(i=0; i