/****************************************************************************** * FILE: minim1.c * DESCRIPTION: * This is a very minimal program using Pthreads. The main function * creates 4 threads. Each thread executes a function which prints out the * thread "number". * * SOURCE: Vijay Sonnad, IBM * LAST REVISED: 9/20/98 Blaise Barney ******************************************************************************/ #include #include #define NUMTHDS 4 void *thrdfun (void *arg); int main(int argc, char *argv[]) { /* We define an array of thread identifiers which are later used as in the call to to create threads. */ pthread_t thrdid[NUMTHDS]; int i; /* Create threads using default values for the attributes, (specified by setting NULL as the argument in the call). Note that in this version of AIX (which uses Draft7 of POSIX.1c) the default is "detached"; thus any attempt to join with any of these threads will result in an error. */ for (i=0; i