int main() { pthread_t threads[ NUM_THREADS ]; int rc, t; for ( t = 0; t < NUM_THREADS; t++ ) { printf( "Creating thread %d\n", t ); pthread_create( &threads[ t ], NULL, thread, ( void * ) t ); } pthread_exit( NULL ); }