summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Miedema <thomasmiedema@gmail.com>2015-03-22 12:04:18 +0100
committerThomas Miedema <thomasmiedema@gmail.com>2015-03-22 12:11:54 +0100
commit5449b25d02cca0c4ae706c9152f5f2c6107fe711 (patch)
tree0c98e759836812a8692fdf8627807222810ae782
parent899cb3e768bf495b396f59dc2b49b7b10eb4ad8c (diff)
downloadhaskell-5449b25d02cca0c4ae706c9152f5f2c6107fe711.tar.gz
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
-rw-r--r--rts/Task.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/rts/Task.c b/rts/Task.c
index 42893fe903..be72c1bd23 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;