source: trunk/Softwares/MiBench/src/c/main.c @ 137

Last change on this file since 137 was 137, checked in by rosiere, 14 years ago

Various modif (add test, and vhdl)

  • Property svn:keywords set to Id
File size: 737 bytes
Line 
1// $Id: main.c 137 2010-02-16 12:35:48Z rosiere $
2
3//=====[ main ]=================================================================
4/*
5 * All thread execute this routine
6 * Initialize the thread and attribute a Workload at each thread
7 */
8
9#include <stdlib.h>
10#include <stdio.h>
11#include <sys/types.h>
12#include <unistd.h>
13
14#include "workload.h"
15
16int main()
17{
18#ifdef Morpheo
19  int pid = (int)getpid();
20 
21  printf("Start process %d\n",pid);
22 
23  if ((pid < NB_THREAD_MAX) && 
24      (pid < (int)NB_WORKLOAD))
25    (*WorkLoad[pid])();
26  else
27    printf("The number of function in the workload is %d. (maximum of thread is : %d)\n",(int)NB_WORKLOAD,NB_THREAD_MAX);
28#endif
29
30#ifdef UNIX
31  for (int i=0; i<(int)NB_WORKLOAD; ++i)
32    (*WorkLoad[i])();
33#endif
34
35  exit (0);
36
37  while (1);
38}
Note: See TracBrowser for help on using the repository browser.