diff options
author | Simon Marlow <marlowsd@gmail.com> | 2011-12-12 16:28:29 +0000 |
---|---|---|
committer | Simon Marlow <marlowsd@gmail.com> | 2011-12-13 15:02:11 +0000 |
commit | 40dd50a9d1d92a7bd8526b54ca5fcdd1eb95d42f (patch) | |
tree | 899a837cb92b43a4410210f67e1d782686d9808a /rts/sm | |
parent | 66b047ee8528860ef4babdbe38cf708a41e3be1e (diff) | |
download | haskell-40dd50a9d1d92a7bd8526b54ca5fcdd1eb95d42f.tar.gz |
Add a comment about oddity with yieldThread() and timing results on Linux
Diffstat (limited to 'rts/sm')
-rw-r--r-- | rts/sm/GC.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/rts/sm/GC.c b/rts/sm/GC.c index 928f4448d3..993de51bf8 100644 --- a/rts/sm/GC.c +++ b/rts/sm/GC.c @@ -1060,6 +1060,11 @@ gcWorkerThread (Capability *cap) // Wait until we're told to wake up RELEASE_SPIN_LOCK(&gct->mut_spin); + // yieldThread(); + // Strangely, adding a yieldThread() here makes the CPU time + // measurements more accurate on Linux, perhaps because it syncs + // the CPU time across the multiple cores. Without this, CPU time + // is heavily skewed towards GC rather than MUT. gct->wakeup = GC_THREAD_STANDING_BY; debugTrace(DEBUG_gc, "GC thread %d standing by...", gct->thread_index); ACQUIRE_SPIN_LOCK(&gct->gc_spin); |