Currently I compile happstack apps with -threaded in the .cabal file,
but I don't run with +RTS -N4 (I have four processors on my linode).
Am I doing it wrong?
--
Need somewhere to put your code? http://patch-tag.com
Want to build a webapp? http://happstack.com
Unless I'm missing something, yes, you are. -threaded only makes it
*possible* to use multiple processors, as I've understood it, +RTS -N4
-RTS actually makes a particular invocation use multiple processors.
At least, this is how I've always understood it.
(I remember reading that it is possible for a program to fiddle with
its own RTS options so that in theory one could specify -threaded in
the .cabal and then the fiddling could auto -N4, or use the
system-information module to find out how many processors are
available and set -Nn, but this was difficult and ill-advised for some
reason.)
--
gwern
You compile with -threaded to get the multithreaded runtime, and if you
want to use more than one core to run those forkIO'd threads, then
you'll need +RTS -N4 or more, otherwise it will pin them to one core.
-- Don