[commit: ghc] master: Clarify meaning of the RTS `taskCount` variable (5449b25)

git at git.haskell.org git at git.haskell.org
Sun Mar 22 11:13:13 UTC 2015


Repository : ssh://git@git.haskell.org/ghc

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/5449b25d02cca0c4ae706c9152f5f2c6107fe711/ghc

>---------------------------------------------------------------

commit 5449b25d02cca0c4ae706c9152f5f2c6107fe711
Author: Thomas Miedema <thomasmiedema at gmail.com>
Date:   Sun Mar 22 12:04:18 2015 +0100

    Clarify meaning of the RTS `taskCount` variable
    
    In #9261, there was some confusion about the meaning of the taskCount
    stats variable in the rts.
    
    It turns out that taskCount is not decremented when a worker task is
    stopped (i.e. from workerTaskStop), but only when freeMyTask is called,
    which frees the task bound to the current thread. So taskCount is the
    current number of bound tasks + the total number of worker tasks.
    
    This makes the calculation of the current number of bound tasks in
    rts/Stats.c correct _as is_.
    
    [skip ci]
    
    Reviewed By: austin
    
    Differential Revision: https://phabricator.haskell.org/D746


>---------------------------------------------------------------

5449b25d02cca0c4ae706c9152f5f2c6107fe711
 rts/Task.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/rts/Task.c b/rts/Task.c
index 42893fe..be72c1b 100644
--- a/rts/Task.c
+++ b/rts/Task.c
@@ -27,7 +27,7 @@
 // Locks required: all_tasks_mutex.
 Task *all_tasks = NULL;
 
-nat taskCount;
+nat taskCount; // current number of bound tasks + total number of worker tasks.
 nat workerCount;
 nat currentWorkerCount;
 nat peakWorkerCount;



More information about the ghc-commits mailing list