summaryrefslogtreecommitdiff
path: root/ghc/rts/Task.c
diff options
context:
space:
mode:
authorwolfgang <unknown>2003-10-01 10:49:09 +0000
committerwolfgang <unknown>2003-10-01 10:49:09 +0000
commit324e96d2ebfcb113cd97c43ef043d591ef87de71 (patch)
treeb5b38d8ec16bc56010132ef73710577e85122952 /ghc/rts/Task.c
parentaefc6956f4828708e1343cf4858296fc3141a176 (diff)
downloadhaskell-324e96d2ebfcb113cd97c43ef043d591ef87de71.tar.gz
[project @ 2003-10-01 10:49:07 by wolfgang]
Threaded RTS: Don't start new worker threads earlier than necessary. After this commit, a Haskell program that uses neither forkOS nor forkIO is really single-threaded (rather than using two OS threads internally). Some details: Worker threads are now only created when a capability is released, and only when (there are no worker threads) && (there are runnable Haskell threads || there are Haskell threads blocked on IO or threadDelay) awaitEvent can now be called from bound thread scheduling loops (so that we don't have to create a worker thread just to run awaitEvent)
Diffstat (limited to 'ghc/rts/Task.c')
-rw-r--r--ghc/rts/Task.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/ghc/rts/Task.c b/ghc/rts/Task.c
index 92b5c2594f..c720538995 100644
--- a/ghc/rts/Task.c
+++ b/ghc/rts/Task.c
@@ -134,6 +134,12 @@ stopTaskManager ()
return;
}
+void
+resetTaskManagerAfterFork ()
+{
+ barf("resetTaskManagerAfterFork not implemented for SMP");
+}
+
#else
/************ THREADS version *****************/
@@ -192,6 +198,13 @@ stopTaskManager ()
{
}
+
+void
+resetTaskManagerAfterFork ()
+{
+ rts_n_waiting_tasks = 0;
+ taskCount = 0;
+}
#endif