Oh, thanks! I wasn't aware of either or these! Useful to know. <div><br></div><div>That does cover the use case I could think of. </div><div><br></div><div>Thanks, </div><div>Tamar <br><br><div class="gmail_quote"><div dir="ltr">On Mon, Oct 10, 2016, 14:34 Ben Gamari <<a href="mailto:ben@well-typed.com">ben@well-typed.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Phyx <<a href="mailto:lonetiger@gmail.com" class="gmail_msg" target="_blank">lonetiger@gmail.com</a>> writes:<br class="gmail_msg">
<br class="gmail_msg">
> Oops, sorry, only just now seen this. It seems my overly aggressive filters<br class="gmail_msg">
> couldn't decide where to put the email :)<br class="gmail_msg">
><br class="gmail_msg">
> I do agree to some extend with this. I'd prefer if I made a mistake for my<br class="gmail_msg">
> system not to hang. The one downside to this default though is that you<br class="gmail_msg">
> can't just hand a program over to user and have it run at full capabilities.<br class="gmail_msg">
><br class="gmail_msg">
> If it possible to set this from inside a program? My guess is no, since by<br class="gmail_msg">
> the time you get to main the rts is already initialized?<br class="gmail_msg">
><br class="gmail_msg">
> Would a useful alternative be to provide a compile flag that would change<br class="gmail_msg">
> the default? e.g. opt-in? Since now there is a small burden on the end user.<br class="gmail_msg">
><br class="gmail_msg">
There exist two pretty good tools for accomplishing what you want,<br class="gmail_msg">
<br class="gmail_msg">
1. Call Control.Concurrent.setNumCapabilities [1] from within your<br class="gmail_msg">
application.<br class="gmail_msg">
<br class="gmail_msg">
2. Use GHC's -with-rtsopts flag [2] to set the default RTS arguments<br class="gmail_msg">
during compilation of your application.<br class="gmail_msg">
<br class="gmail_msg">
Cheers,<br class="gmail_msg">
<br class="gmail_msg">
- Ben<br class="gmail_msg">
<br class="gmail_msg">
<br class="gmail_msg">
[1] <a href="http://localhost:7000/file/opt/exp/ghc/roots/8.0.1/share/doc/ghc-8.0.1/html/libraries/base-4.9.0.0/Control-Concurrent.html#v:setNumCapabilities" rel="noreferrer" class="gmail_msg" target="_blank">http://localhost:7000/file/opt/exp/ghc/roots/8.0.1/share/doc/ghc-8.0.1/html/libraries/base-4.9.0.0/Control-Concurrent.html#v:setNumCapabilities</a><br class="gmail_msg">
[2] <a href="http://downloads.haskell.org/~ghc/master/users-guide//phases.html?highlight=#ghc-flag--with-rtsopts" rel="noreferrer" class="gmail_msg" target="_blank">http://downloads.haskell.org/~ghc/master/users-guide//phases.html?highlight=#ghc-flag--with-rtsopts</a><br class="gmail_msg">
</blockquote></div></div>