#include #include #define THREADS 4 /* the function called for each thread */ void* f(void* data) { printf("Hello from a thread!\n"); pthread_exit(NULL); } int main() { /* an array of threads */ pthread_t threads[THREADS]; for (int t = 0; t < THREADS; t++) { pthread_create(&threads[t], NULL, f, NULL); } pthread_exit(NULL); }