Commit 5449b25d authored by thomie's avatar thomie

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
parent 899cb3e7
......@@ -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;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment