#include <sys/wait.h>
#include <stdlib.h>
#include <unistd.h>
#include <pthread.h>
#include <stdbool.h>
#include <stdio.h>

#define N_THREADS 100

static void *
worker (void *arg)
{
  pid_t pid;

  pid = fork ();

  if (pid == -1)
    abort ();

  if (pid == 0)
    {
      char *args[] = { "/bin/true", NULL };
      execv ("/bin/true", args);
      abort ();
    }

  waitpid (pid, NULL, 0);

  return NULL;
}

int
main (void)
{
  pthread_t threads[N_THREADS];
  int i;

  while (true)
    {
      for (i = 0; i < N_THREADS; i++)
        pthread_create (&threads[i], NULL, worker, NULL);

      for (i = 0; i < N_THREADS; i++)
        pthread_join (threads[i], NULL);

      putchar ('.');
      fflush (stdout);
    }
}
