<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><font class="Apple-style-span" face="'Helvetica Neue'"><span></span>Hi,</font><div><font class="Apple-style-span" face="'Helvetica Neue'">I've just done the "ring benchmark" from the end of Chapter 8 in the Joe Armstrong book (Programming Erlang: Software for a Concurrent World). </font></div><div><font class="Apple-style-span" face="'Helvetica Neue'"><br></font></div><div><font class="Apple-style-span" face="'Helvetica Neue'">I think I have a module that does what is asked in the problem "<span class="Apple-style-span" style="font-family: Helvetica; ">(<font style="font: 10.0px Helvetica"><font class="Apple-style-span" face="'Helvetica Neue'" size="3">Write a ring benchmark. Create</font></font><font style="font: 12.0px Helvetica"><font class="Apple-style-span" face="'Helvetica Neue'"> </font></font><font style="font: 9.0px Helvetica"><font class="Apple-style-span" face="'Helvetica Neue'" size="3">N</font></font><font style="font: 12.0px Helvetica"><font class="Apple-style-span" face="'Helvetica Neue'"> </font></font><font style="font: 10.0px Helvetica"><font class="Apple-style-span" face="'Helvetica Neue'" size="3">processes in a ring. Send a mes<span class="Apple-style-span" style="font-family: Helvetica; "><font style="font: 10.0px Helvetica"><font class="Apple-style-span" face="'Helvetica Neue'" size="3">sage round the ring</font></font><font style="font: 12.0px Helvetica"><font class="Apple-style-span" face="'Helvetica Neue'"> </font></font><font style="font: 9.0px Helvetica"><font class="Apple-style-span" face="'Helvetica Neue'" size="3">M</font></font><font style="font: 12.0px Helvetica"><font class="Apple-style-span" face="'Helvetica Neue'"> </font></font><font style="font: 10.0px Helvetica"><font class="Apple-style-span" face="'Helvetica Neue'" size="3">times so that a total of</font></font><font style="font: 12.0px Helvetica"><font class="Apple-style-span" face="'Helvetica Neue'"> </font></font><font style="font: 9.0px Helvetica"><font class="Apple-style-span" face="'Helvetica Neue'" size="3">N * M</font></font><font style="font: 12.0px Helvetica"><font class="Apple-style-span" face="'Helvetica Neue'"> </font></font><font style="font: 10.0px Helvetica"><font class="Apple-style-span" face="'Helvetica Neue'" size="3">messages get <span class="Apple-style-span" style="font-family: Helvetica; "><font style="font: 10.0px Helvetica"><font class="Apple-style-span" face="'Helvetica Neue'" size="3">sent. Time how long this takes for different values of</font></font><font style="font: 12.0px Helvetica"><font class="Apple-style-span" face="'Helvetica Neue'"> </font></font><font style="font: 9.0px Helvetica"><font class="Apple-style-span" face="'Helvetica Neue'" size="3">N</font></font><font style="font: 12.0px Helvetica"><font class="Apple-style-span" face="'Helvetica Neue'"> </font></font><font style="font: 10.0px Helvetica"><font class="Apple-style-span" face="'Helvetica Neue'" size="3">and</font></font><font style="font: 12.0px Helvetica"><font class="Apple-style-span" face="'Helvetica Neue'"> </font></font><font style="font: 9.0px Helvetica"><font class="Apple-style-span" face="'Helvetica Neue'" size="3">M</font></font><font style="font: 10.0px Helvetica"><font class="Apple-style-span" face="'Helvetica Neue'" size="3">.)"</font></font></span></font></font></span></font></font></span></font></div><div><font class="Apple-style-span" face="'Helvetica Neue'"><br></font></div><div><font class="Apple-style-span" face="'Helvetica Neue'">I am certain it is nowhere near the best or most elegant way to do it as I am not very accomplished (but I do like to have a go anyway). What I am wondering is why, when I run the "benchmark" only one of the cores on my laptop's dual core seems to get used. Have I written it wrong (so that there is no concurrency) or is a ring by its nature a sequential thing?</font></div><div><font class="Apple-style-span" face="'Helvetica Neue'"><br></font></div><div><font class="Apple-style-span" face="'Helvetica Neue'">I have attached the code in case it helps answer the above question. As I say I am a total newb. My reason for posting is just to verify that the implementation works and to find out why it only uses one core.</font></div><div><br></div><div>Also, is there a canonical implementation that beginners like me can have a look at?</div><div><font class="Apple-style-span" face="'Helvetica Neue'"><br></font></div><div><font class="Apple-style-span" face="'Helvetica Neue'">Many thanks in advance</font></div><div><font class="Apple-style-span" face="'Helvetica Neue'"><br></font></div><div><font class="Apple-style-span" face="'Helvetica Neue'">Russell</font></div></body></html>