#include #include #include #include #define NUM_THREADS 5 void *TaskCode(void *argument) { int tid; tid = *((int *) argument); printf("Hello World! It's me, thread %d!\n", tid); /* optionally: insert more useful stuff here */ return NULL; } int main(void) { pthread_t threads[NUM_THREADS]; int thread_args[NUM_THREADS]; int rc, i; /* create all threads */ for (i=0; i