[project @ 2004-02-12 02:04:59 by mthomas]
[ghc-hetmet.git] / ghc / rts / Task.h
1 /* -----------------------------------------------------------------------------
2  *
3  * (c) The GHC Team 2001-2003
4  *
5  * Types + prototypes for functions in Task.c
6  * (RTS subsystem for handling tasks, agents thay may execute STG code).
7  *
8  * -------------------------------------------------------------------------*/
9 #ifndef __TASK_H__
10 #define __TASK_H__
11 #if defined(RTS_SUPPORTS_THREADS) /* to the end */
12
13 /* 
14  * Tasks evaluate STG code; the TaskInfo structure collects together
15  * misc metadata about a task.
16  * 
17  */
18 typedef struct _TaskInfo {
19   OSThreadId id;
20   double     elapsedtimestart;
21   double     mut_time;
22   double     mut_etime;
23   double     gc_time;
24   double     gc_etime;
25 } TaskInfo;
26
27 extern TaskInfo *taskIds;
28
29 extern void startTaskManager ( nat maxTasks, void (*taskStart)(void) );
30 extern void stopTaskManager ( void );
31 extern void resetTaskManagerAfterFork ( void );
32
33 extern void startTask ( void (*taskStart)(void) );
34
35 #endif /* RTS_SUPPORTS_THREADS */
36 #endif /* __TASK_H__ */