Same with just about every other use of Int in the standard libraries and even GHC.Prim :)<br><br><div class="gmail_quote">On Wed, Dec 22, 2010 at 5:03 PM, Iavor Diatchki <span dir="ltr">&lt;<a href="mailto:iavor.diatchki@gmail.com">iavor.diatchki@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Hello,<br>
Just a minor comment about the types:  it seems a lot more natural to<br>
use Word instead of Int to identify CPUs and to report the number of<br>
capabilities.  I can&#39;t think of any meaningful use of negative numbers<br>
in these functions.<br>
<font color="#888888">-Iavor<br>
</font><div><div></div><div class="h5"><br>
<br>
<br>
On Wed, Dec 22, 2010 at 8:08 AM, Simon Marlow &lt;<a href="mailto:marlowsd@gmail.com">marlowsd@gmail.com</a>&gt; wrote:<br>
&gt; On 22/12/2010 15:55, Duncan Coutts wrote:<br>
&gt;&gt;<br>
&gt;&gt; On 22 December 2010 11:41, Simon Marlow&lt;<a href="mailto:marlowsd@gmail.com">marlowsd@gmail.com</a>&gt;  wrote:<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; Ticket:<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;  <a href="http://hackage.haskell.org/trac/ghc/ticket/4859" target="_blank">http://hackage.haskell.org/trac/ghc/ticket/4859</a><br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; I think these functions are implementation-independent enough to add to<br>
&gt;&gt;&gt; the<br>
&gt;&gt;&gt; main `Control.Concurrent` API:<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; {{{<br>
&gt;&gt;&gt; {- |<br>
&gt;&gt;&gt; Like &#39;forkIO&#39;, but lets you specify on which CPU the thread is<br>
&gt;&gt;&gt; created.  Unlike a `forkIO` thread, a thread created by `forkOnIO`<br>
&gt;&gt;&gt; will stay on the same CPU for its entire lifetime (`forkIO` threads<br>
&gt;&gt;&gt; can migrate between CPUs according to the scheduling policy).<br>
&gt;&gt;&gt; `forkOnIO` is useful for overriding the scheduling policy when you<br>
&gt;&gt;&gt; know in advance how best to distribute the threads.<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; The `Int` argument specifies the CPU number; it is interpreted modulo<br>
&gt;&gt;&gt; the value returned by &#39;getNumCapabilities&#39;.<br>
&gt;&gt;<br>
&gt;&gt; While Int is clearly enough for a multi-processors single node system,<br>
&gt;&gt; I wonder if there is something slightly more general that would give<br>
&gt;&gt; us a common API with the Eden / distributed Haskell people. For<br>
&gt;&gt; example in MPI the identification of a node is rather more complex<br>
&gt;&gt; than a single integer. Perhaps some more abstract identifier for a<br>
&gt;&gt; capability would be useful. Closely related of course is how one<br>
&gt;&gt; discovers the available capabilities.<br>
&gt;<br>
&gt; There aren&#39;t any systems that support remote forkIO, and it&#39;s not clear that<br>
&gt; forkIO is the right abstraction for a distributed system.  See for example<br>
&gt; the design at<br>
&gt;<br>
&gt;  <a href="http://hackage.haskell.org/trac/ghc/wiki/ErlangInHaskell" target="_blank">http://hackage.haskell.org/trac/ghc/wiki/ErlangInHaskell</a><br>
&gt;<br>
&gt; which uses a different primitive for remote forks.<br>
&gt;<br>
&gt; I think we can safely consider forkIO (and forkOnIO) to be node-local forks,<br>
&gt; so we don&#39;t have to worry about a more complex node structure here.<br>
&gt;<br>
&gt; Cheers,<br>
&gt;        Simon<br>
&gt;<br>
&gt; _______________________________________________<br>
&gt; Libraries mailing list<br>
&gt; <a href="mailto:Libraries@haskell.org">Libraries@haskell.org</a><br>
&gt; <a href="http://www.haskell.org/mailman/listinfo/libraries" target="_blank">http://www.haskell.org/mailman/listinfo/libraries</a><br>
&gt;<br>
<br>
_______________________________________________<br>
Libraries mailing list<br>
<a href="mailto:Libraries@haskell.org">Libraries@haskell.org</a><br>
<a href="http://www.haskell.org/mailman/listinfo/libraries" target="_blank">http://www.haskell.org/mailman/listinfo/libraries</a><br>
</div></div></blockquote></div><br>