[erlang-questions] Notes about the modified chameneos/broker benchmark code I posted

Edwin Fine erlang-questions_efine@REDACTED
Sun Oct 12 23:01:51 CEST 2008

I forgot to add this in the original email.

The code I sent to this list is based on the code posted to alioth for the
benchmark game. I modified it heavily.

The code as I modified it has a bug (or two): it expects there to be at
least 2 chameneos (requester process) per broker. The reason for this is
that (a) the code forces a broker to communicate only with chameneos running
on the same node as the broker (unless you change the foldr to foldl as
commented in the code) and (b) as in the original benchmark, the broker
waits for pairs of messages, and will time out if there are fewer than 2
chameneos running on that node.

The number of chameneos is currently hard-coded to 10 (by the colors list
having 10 colors), so you can't have more than 5 nodes, otherwise there will
be nodes that only have 1 chameneos per broker and the broker will time out.
I am sure there are other bugs, given the hasty hacking, but I do believe
that the code performs the algorithm from the benchmark correctly. If not,
sorry, please let me know where I went wrong. Obviously if you parameterize
it so that the chameneos to broker ratio is correct (>=2:1) then you can
have as many nodes as you like.

The way I wrote it to start up and distribute brokers and chameneos is
probably very naive, and buggy, but I don't feel too bad about it because I
was in a hurry and just trying to get something working to do some
measurements, not write production-quality code. Nevertheless, I do
apologize if this disgusts or annoys someone. If someone is kind enough to
fix the bugs and "expertise" the code, I'd really like to see it the way it
should be written.

Edwin Fine
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20081012/86933036/attachment.htm>

More information about the erlang-questions mailing list