muffel
muffel

Reputation: 7360

Get number of threads (HECs) at runtime

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

Answers (1)

Daniel Wagner
Daniel Wagner

Reputation: 152817

Use getNumCapabilities. It also has a counterpart setNumCapabilities for changing the number of threads programmatically.

Upvotes: 4

Related Questions