X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=rts%2FCapability.h;h=2daade8d60d875e6f7758eafe40f5006e6710e64;hb=26f4bfc82f2b2359259578e9c54d476fc2de650f;hp=e12b8ce6e9820520e10d6a9b6e8a9395fc7a1f4d;hpb=5d52d9b64c21dcf77849866584744722f8121389;p=ghc-hetmet.git diff --git a/rts/Capability.h b/rts/Capability.h index e12b8ce..2daade8 100644 --- a/rts/Capability.h +++ b/rts/Capability.h @@ -4,6 +4,9 @@ * * Capabilities * + * For details on the high-level design, see + * http://hackage.haskell.org/trac/ghc/wiki/Commentary/Rts/Scheduler + * * A Capability holds all the state an OS thread/task needs to run * Haskell code: its STG registers, a pointer to its TSO, a nursery * etc. During STG execution, a pointer to the Capabilitity is kept in @@ -22,7 +25,7 @@ #include "Task.h" #include "Sparks.h" -BEGIN_RTS_PRIVATE +#include "BeginPrivate.h" struct Capability_ { // State required by the STG virtual machine when running Haskell @@ -76,6 +79,7 @@ struct Capability_ { #if defined(THREADED_RTS) // Worker Tasks waiting in the wings. Singly-linked. Task *spare_workers; + nat n_spare_workers; // count of above // This lock protects running_task, returning_tasks_{hd,tl}, wakeup_queue. Mutex lock; @@ -95,8 +99,10 @@ struct Capability_ { // Stats on spark creation/conversion nat sparks_created; + nat sparks_dud; nat sparks_converted; - nat sparks_pruned; + nat sparks_gcd; + nat sparks_fizzled; #endif // Per-capability STM-related data @@ -199,9 +205,9 @@ extern volatile StgWord waiting_for_gc; // void waitForReturnCapability (Capability **cap/*in/out*/, Task *task); -INLINE_HEADER void recordMutableCap (StgClosure *p, Capability *cap, nat gen); +EXTERN_INLINE void recordMutableCap (StgClosure *p, Capability *cap, nat gen); -INLINE_HEADER void recordClosureMutated (Capability *cap, StgClosure *p); +EXTERN_INLINE void recordClosureMutated (Capability *cap, StgClosure *p); #if defined(THREADED_RTS) @@ -273,7 +279,7 @@ void freeCapabilities (void); // For the GC: void markSomeCapabilities (evac_fn evac, void *user, nat i0, nat delta, - rtsBool prune_sparks); + rtsBool no_mark_sparks); void markCapabilities (evac_fn evac, void *user); void traverseSparkQueues (evac_fn evac, void *user); @@ -291,7 +297,7 @@ INLINE_HEADER rtsBool emptyInbox(Capability *cap);; * INLINE functions... private below here * -------------------------------------------------------------------------- */ -INLINE_HEADER void +EXTERN_INLINE void recordMutableCap (StgClosure *p, Capability *cap, nat gen) { bdescr *bd; @@ -310,7 +316,7 @@ recordMutableCap (StgClosure *p, Capability *cap, nat gen) *bd->free++ = (StgWord)p; } -INLINE_HEADER void +EXTERN_INLINE void recordClosureMutated (Capability *cap, StgClosure *p) { bdescr *bd; @@ -354,6 +360,6 @@ INLINE_HEADER rtsBool emptyInbox(Capability *cap) #endif -END_RTS_PRIVATE +#include "EndPrivate.h" #endif /* CAPABILITY_H */