How to find the number of cores at runtime in Haskell

前端 未结 5 1647
野趣味
野趣味 2021-02-13 06:22

Does Haskell have a method for determining the number of CPU cores present on a machine at runtime?

5条回答
  •  不思量自难忘°
    2021-02-13 06:28

    It is GHC.Conc.getNumProcessors :: IO Int getNumCapabilities tells how many threads are suggested to GHC (and depends on +RTS -N option parameter.)

提交回复
热议问题