/[pdpsoft]/trunk/grid-mw-security/ees/src/app/aos_threading_test.c
ViewVC logotype

Contents of /trunk/grid-mw-security/ees/src/app/aos_threading_test.c

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1353 - (show annotations) (download) (as text)
Sat Jan 9 00:19:12 2010 UTC (12 years, 4 months ago) by aramv
File MIME type: text/x-chdr
File size: 999 byte(s)
Cleaned up a bit and tossed out all the dead code
1 #define _MULTI_THREADED
2 #define NUM_THREADS 40
3
4 #include <stdio.h>
5 #include <stdlib.h>
6 #include <pthread.h>
7 #include "config.h"
8 #include "eef.h"
9 #include "aos.h"
10
11 int main (int argc, char* argv[]){
12 char* config_file;
13 pthread_t threads[NUM_THREADS];
14 long t;
15 int rc;
16 void* status;
17
18 /*sleep(10);*/
19
20 if(argc > 1){
21 config_file = argv[1];
22 } else {
23 config_file = "examples/example_1.pdl";
24 }
25
26 printf("Parsing config file %s\n", config_file);
27
28 if(EEF_Init(config_file, NULL, 0, NULL) == EES_FAILURE){
29 eef_log(LOG_ERR, "Failed to parse config file (%s), exiting...", config_file);
30 } else {
31 aos_start_threading();
32 /* start threading */
33 for(t=0; t < NUM_THREADS; t++){
34 printf("Creating thread %li!\n", t);
35 rc = pthread_create(&threads[t], NULL, (void*)(void*) EEF_Run, (void*)(t));
36 rc = pthread_join(threads[t], &status);
37 }
38 }
39 /*sleep(10);*/
40 EEF_Term();
41 printf("terminated!\n");
42
43 /*sleep(10);*/
44
45 pthread_exit(NULL);
46 return 0;
47 }
48

grid.support@nikhef.nl
ViewVC Help
Powered by ViewVC 1.1.28