summaryrefslogtreecommitdiff
path: root/includes
diff options
context:
space:
mode:
authorSimon Marlow <marlowsd@gmail.com>2008-10-22 09:27:44 +0000
committerSimon Marlow <marlowsd@gmail.com>2008-10-22 09:27:44 +0000
commit99df892cc9620fcc92747b79bba75dad8a1d295c (patch)
tree536df57e1d9975f88ce781627bb2dacaee5b2c0c /includes
parentcf9650f2a1690c04051c716124bb0350adc74ae7 (diff)
downloadhaskell-99df892cc9620fcc92747b79bba75dad8a1d295c.tar.gz
Refactoring and reorganisation of the scheduler
Change the way we look for work in the scheduler. Previously, checking to see whether there was anything to do was a non-side-effecting operation, but this has changed now that we do work-stealing. This lead to a refactoring of the inner loop of the scheduler. Also, lots of cleanup in the new work-stealing code, but no functional changes. One new statistic is added to the +RTS -s output: SPARKS: 1430 (2 converted, 1427 pruned) lets you know something about the use of `par` in the program.
Diffstat (limited to 'includes')
-rw-r--r--includes/RtsTypes.h46
1 files changed, 7 insertions, 39 deletions
diff --git a/includes/RtsTypes.h b/includes/RtsTypes.h
index 3510ee7615..d4970053e7 100644
--- a/includes/RtsTypes.h
+++ b/includes/RtsTypes.h
@@ -1,8 +1,10 @@
-/*
- Time-stamp: <2005-03-30 12:02:33 simonmar>
-
- RTS specific types.
-*/
+/* -----------------------------------------------------------------------------
+ *
+ * (c) The GHC Team, 1998-2008
+ *
+ * RTS-specific types.
+ *
+ * ---------------------------------------------------------------------------*/
/* -------------------------------------------------------------------------
Generally useful typedefs
@@ -37,40 +39,6 @@ typedef enum {
Types specific to the parallel runtime system.
*/
-
-/* Spark pools: used to store pending sparks
- * (THREADED_RTS & PARALLEL_HASKELL only)
- * Implementation uses a DeQue to enable concurrent read accesses at
- * the top end.
- */
-typedef struct SparkPool_ {
- /* Size of elements array. Used for modulo calculation: we round up
- to powers of 2 and use the dyadic log (modulo == bitwise &) */
- StgWord size;
- StgWord moduloSize; /* bitmask for modulo */
-
- /* top, index where multiple readers steal() (protected by a cas) */
- StgWord top;
-
- /* bottom, index of next free place where one writer can push
- elements. This happens unsynchronised. */
- StgWord bottom;
- /* both position indices are continuously incremented, and used as
- an index modulo the current array size. */
-
- /* lower bound on the current top value. This is an internal
- optimisation to avoid unnecessarily accessing the top field
- inside pushBottom */
- StgWord topBound;
-
- /* The elements array */
- StgClosurePtr* elements;
- /* Please note: the dataspace cannot follow the admin fields
- immediately, as it should be possible to enlarge it without
- disposing the old one automatically (as realloc would)! */
-
-} SparkPool;
-
typedef ullong rtsTime;
#if defined(PAR)