How can I do one of the following?
- get a list of
ThreadID
s all running forked threads (preferably with labels) from application code? - get a simple (maybe approximate; e.g. from the last major GC), count of running threads
- get either of the above from
gdb
or similar
Things that don't work for me:
- requiring a profiling build
- maintaining some data structure to try to track this information myself
Things I thought might be promising:
- write a custom eventlog hook to try to get this info https://downloads.haskell.org/~ghc/latest/docs/html/users_guide/runtime_control.html#hooks-to-change-rts-behaviour
- create a hacky RTS binding somehow
async
or something). I suppose I could do the former with confidence if I just storeThreadId
s in a set and have a thread that polls them periodically and only removes them when the status shows "terminated" or whatever – Calcifuge