Change the local hashtable for recording the pointer mapping info used in the gc...
[IRC.git] / Robust / src / Runtime / workschedule.h
1 #ifndef __WORK_SCHEDULE__
2 #define __WORK_SCHEDULE__
3
4
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*) );
12
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 );
20
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();
25
26 extern int threadcount;
27 extern pthread_mutex_t gclock;
28 extern pthread_mutex_t gclistlock;
29 extern pthread_cond_t gccond;
30
31 struct QI {
32   struct QI * next;
33   void * value;
34 };
35
36 struct QI * headqi;
37 struct QI * tailqi;
38
39
40 #endif /* __WORK_SCHEDULE__ */