Number of threads in haskell program
ben at smart-cactus.org
Wed Mar 4 13:47:47 UTC 2020
"chessai ." <chessai1996 at gmail.com> writes:
> Hi devs,
> Recently I became interested in obtaining the rough number of (non-GC)
> threads that are alive in a Haskell program. Intuitively this seemed
> like something that the RTS would expose in some way - but I couldn't
> find any such exposition in base. I then thought that I could simply
> total the size of each run_queue_hd in each capability, but the
> machinery for doing that doesn't seem to be exposed. Any thoughts?
Indeed I also needed this functionality in the past. I have a patch
(just posted as !2816) which may need some polish which adds a
`listThreads#` primop. Perhaps you want to pick it up?
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 487 bytes
Desc: not available
More information about the ghc-devs