/****************************************************************************** * FILE: hellodumpfix.c * DESCRIPTION: * This is just one way to fix the "hello world" Pthreads program that dumps * core. Things to note: * - attr variable and its scoping * - use of the pthread_attr_setstacksize routine * - initialization of the attr variable with pthread_attr_init * - passing the attr variable to pthread_create * * LAST REVISED: 02/11/2002 Blaise Barney ******************************************************************************/ #include #include #define NTHREADS 8 #define ARRAY_SIZE 16000 pthread_attr_t attr; void *Hello(void *threadid) { double A[ARRAY_SIZE]; int i; size_t mystacksize; sleep(3); for (i=0; i