#include #include #include #include static void * rand_invocator_thread (void *arg) { printf ("Value from separate thread: %d\n", rand ()); return NULL; } int main () { unsigned int seed = 19891109; srand (seed); printf ("Value from main thread: %d\n", rand ()); srand (seed); pthread_t t; assert (pthread_create (&t, NULL, rand_invocator_thread, NULL) == 0); assert (pthread_join (t, NULL) == 0); return 0; }