<div dir="ltr">Oh, this is surprising, I must admit I haven't tried forkIO, but with forkOS is doesn't move the threads across capabilities.<div><br></div><div>Do you know if this is by design or a bug?</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Sat, Oct 8, 2016 at 6:13 PM, Eric Seidel <span dir="ltr"><<a href="mailto:eric@seidel.io" target="_blank">eric@seidel.io</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I would prefer keeping -N1 as a default, especially now that the number<br>
of capabilities can be set at runtime. Programs can then use the more<br>
common -j flag to enable parallelism.<br>
<br>
Regarding -qa, I was experimenting with it over the summer and found its<br>
behavior a bit surprising. It did prevent threads from being moved<br>
between capabilities, but it also forced all of the threads (created<br>
with forkIO) to be *spawned* on the same capability, which was<br>
unexpected. So -N -qa was, in my experience, equivalent to -N1!<br>
<div><div class="h5"><br>
On Sat, Oct 8, 2016, at 09:55, Ben Gamari wrote:<br>
> <a href="mailto:lonetiger@gmail.com">lonetiger@gmail.com</a> writes:<br>
><br>
> > Hi All,<br>
> ><br>
> > A user on <a href="https://ghc.haskell.org/trac/ghc/ticket/11054" rel="noreferrer" target="_blank">https://ghc.haskell.org/trac/<wbr>ghc/ticket/11054</a> has asked why<br>
> > -N -qa isn’t the default for -threaded.<br>
> ><br>
> I'm not sure that scheduling on all of the cores on the user's machine by<br>
> default is a good idea, especially given that our users have<br>
> learned to expect the existing default. Enabling affinity by default<br>
> seems reasonable if we have evidence that it helps the majority of<br>
> applications, but we would first need to introduce an additional<br>
> flag to disable it.<br>
><br>
> In general I think -N1 is a reasonable default as it acknowledges the<br>
> fact that deploying parallelism is not something that can be done<br>
> blindly in many (most?) applications. To make effective use of<br>
> parallelism the user needs to understand their hardware, their<br>
> application, and its interaction with the runtime system and configure<br>
> the RTS appropriately.<br>
><br>
> Of course, this is just my two-cents.<br>
><br>
> Cheers,<br>
><br>
> - Ben<br>
</div></div>> ______________________________<wbr>_________________<br>
> ghc-devs mailing list<br>
> <a href="mailto:ghc-devs@haskell.org">ghc-devs@haskell.org</a><br>
> <a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs" rel="noreferrer" target="_blank">http://mail.haskell.org/cgi-<wbr>bin/mailman/listinfo/ghc-devs</a><br>
> Email had 1 attachment:<br>
> + signature.asc<br>
>   1k (application/pgp-signature)<br>
______________________________<wbr>_________________<br>
ghc-devs mailing list<br>
<a href="mailto:ghc-devs@haskell.org">ghc-devs@haskell.org</a><br>
<a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs" rel="noreferrer" target="_blank">http://mail.haskell.org/cgi-<wbr>bin/mailman/listinfo/ghc-devs</a><br>
</blockquote></div><br></div>