// $Id: main.c 117 2009-05-16 14:42:39Z rosiere $

//=====[ main ]=================================================================
/*
 * All thread execute this routine
 * Initialize the thread and attribute a Workload at each thread
 */

#include <stdlib.h>
#include <stdio.h>
#include <sys/types.h>
#include <unistd.h>

#include "workload.h"

int main()
{
  int pid = (int)getpid();
  
  printf("Start process %d\n",pid);
  
  if ((pid < NB_THREAD_MAX) && 
      (pid < (int)NB_WORKLOAD))
    (*WorkLoad[pid])();
  else
    printf("The number of function in the workload is %d. (maximum of thread is : %d)\n",(int)NB_WORKLOAD,NB_THREAD_MAX);
    
  exit (0);

  while (1);
}
