summaryrefslogtreecommitdiff
path: root/rts/sm/GC.h
diff options
context:
space:
mode:
authorSimon Marlow <simonmar@microsoft.com>2007-10-31 13:07:18 +0000
committerSimon Marlow <simonmar@microsoft.com>2007-10-31 13:07:18 +0000
commitf2ca6deece1ed1724efdd6d2293dc7642059b2f2 (patch)
tree7f08b2b0e7043568bbf9f02dad6e2da7a970efe1 /rts/sm/GC.h
parentd5bd3e829c47c03157cf41cad581d2df44dfd81b (diff)
downloadhaskell-f2ca6deece1ed1724efdd6d2293dc7642059b2f2.tar.gz
Initial parallel GC support
eg. use +RTS -g2 -RTS for 2 threads. Only major GCs are parallelised, minor GCs are still sequential. Don't use more threads than you have CPUs. It works most of the time, although you won't see much speedup yet. Tuning and more work on stability still required.
Diffstat (limited to 'rts/sm/GC.h')
-rw-r--r--rts/sm/GC.h11
1 files changed, 10 insertions, 1 deletions
diff --git a/rts/sm/GC.h b/rts/sm/GC.h
index 69fdc10447..013a901329 100644
--- a/rts/sm/GC.h
+++ b/rts/sm/GC.h
@@ -110,6 +110,10 @@ typedef struct step_workspace_ {
typedef struct gc_thread_ {
#ifdef THREADED_RTS
OSThreadId id; // The OS thread that this struct belongs to
+ Mutex wake_mutex;
+ Condition wake_cond; // So we can go to sleep between GCs
+ rtsBool wakeup;
+ rtsBool exit;
#endif
nat thread_index; // a zero based index identifying the thread
@@ -148,7 +152,8 @@ extern nat N;
extern rtsBool major_gc;
extern gc_thread *gc_threads;
-extern gc_thread *gct; // this thread's gct TODO: make thread-local
+register gc_thread *gct __asm__("%rbx");
+// extern gc_thread *gct; // this thread's gct TODO: make thread-local
extern StgClosure* static_objects;
extern StgClosure* scavenged_static_objects;
@@ -165,6 +170,10 @@ extern StgPtr oldgen_scan;
extern long copied;
extern long scavd_copied;
+#ifdef THREADED_RTS
+extern SpinLock static_objects_sync;
+#endif
+
#ifdef DEBUG
extern nat mutlist_MUTVARS, mutlist_MUTARRS, mutlist_MVARS, mutlist_OTHERS;
#endif