log_loop
CHECKr(pthread_create (&thread[1], NULL, log_loop, NULL));
CHECKr(pthread_create (&thread, NULL, log_loop, NULL));