Reputation: 7360
How do I get the number of threads / HECs (the -N parameter) of a Haskell program that was compiled with -threaded during its runtime?
[Edit] My question is about the number of HECs, not about the number of cores (even though the answer is related) - so the question is not a duplicate.
Upvotes: 2
Views: 240
Reputation: 152817
Use getNumCapabilities
. It also has a counterpart setNumCapabilities
for changing the number of threads programmatically.
Upvotes: 4