/****************************************************************************** * FILE: hellox.c * DESCRIPTION: * A "hello world" Pthreads program. Demonstrates thread creation and * termination. * AUTHOR: Blaise Barney * LAST REVISED: 04/05/05 ******************************************************************************/ #include #include #include void *PrintHello(void *threadid) { printf("\n%d: Hello World!\n", threadid); pthread_exit(NULL); } int main(int argc, char *argv[]) {if (argc<2) { printf("Form: hellox <# threads>\n"); exit(1); } int numThreads=atoi(argv[1]); pthread_t *threads=malloc(sizeof(pthread_t)*numThreads); int rc, t; for(t=0;t