1 #ifndef __WORK_SCHEDULE__
2 #define __WORK_SCHEDULE__
5 // initialize the work schedule system, after
6 // which some preliminary work units can be
7 // scheduled. Note the supplied work func
8 // should operate on a work unit of the type
9 // submitted in the function below
10 void workScheduleInit( int numProcessors,
11 void(*workFunc)(void*) );
13 // your main program, before beginning this
14 // system, or the execution of worker threads
15 // themselves use this submit function to
16 // distribute work units among the worker pool
17 // threads. The workers will dynamically
18 // steal from one another to load balance
19 void workScheduleSubmit( void* workUnit );
21 // once you call this begin function your main
22 // thread becomes a work thread, so programs
23 // should not expect to return from this
24 void workScheduleBegin();
26 extern int threadcount;
27 extern pthread_mutex_t gclock;
28 extern pthread_mutex_t gclistlock;
29 extern pthread_cond_t gccond;
40 #endif /* __WORK_SCHEDULE__ */