0
我一直在关注RWH中的concurrency chapter。我一直在尝试本书中提到的示例程序。以下是代码:numCapabilities不显示正确的核心数
test.hs:
import GHC.Conc (numCapabilities)
main = do
putStrLn $ "number of cores: " ++ show numCapabilities
这是我如何执行它们:
$ ghc -c test.hs
$ ghc -threaded -o test test.o
$ ./test -RTS -N4
number of cores: 1
但我似乎有四个核心:
$ nproc
4
$ cat /proc/cpuinfo
Produces a big output. But shows four processors. (0..3).
任何我做错了什么想法?
是不是应该是'./test + RTS -N4 -RTS'? – bheklilr
@bheklilr啊是的。捂脸。 – Sibi
它发生在我们所有人身上,很高兴这是一个简单的修复 – bheklilr