[erlang-questions] erlang-questions Digest, Vol 23, Issue 25

Gamoto <>
Tue Apr 7 10:54:46 CEST 2009


Suppose you have an industrial machine which send messages following by the checksum calculated by the xor of all bytes, what can I do with your advices ;-)
>Send erlang-questions mailing list submissions to
>	
>
>To subscribe or unsubscribe via the World Wide Web, visit
>	http://www.erlang.org/mailman/listinfo/erlang-questions
>or, via email, send a message with subject or body 'help' to
>	
>
>You can reach the person managing the list at
>	
>
>When replying, please edit your Subject line so it is more specific
>than "Re: Contents of erlang-questions digest..."
>
>
>Today's Topics:
>
>   1. Re: checksum calculation (Richard O'Keefe)
>   2. In a mnesia cluster, which node is queried? (ryeguy)
>   3. Concurrent Processes and the Programming Erlang	book
>      (Camille Troillard)
>
>
>----------------------------------------------------------------------
>
>Message: 1
>Date: Tue, 7 Apr 2009 13:29:18 +1200
>From: "Richard O'Keefe" <>
>Subject: Re: [erlang-questions] checksum calculation
>To: Gamoto <>
>Cc: erlang-questions <>
>Message-ID: <>
>Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes
>
>
>On 6 Apr 2009, at 9:34 pm, Gamoto wrote:
>
>> If it is not a very good solution, would you like to suggest a  
>> better one, for me and the other readers ?\
>
>Suppose you have a block of bytes and there is an
>error that results in one byte being replaced by
>a different byte.  Then an XOR checksum will detect
>that difference.
>
>Suppose there is an error that results in two bytes
>being swapped.  Then an XOR checksum will detect no
>change at all.  Or suppose that two equal bytes are
>both replaced by the same new byte.  Again, nothing
>noticed by XOR.
>
>Just look "checksum" up in the Wikipedia; that's as
>good a place as any to start.
>
>The 'zlib' module in Erlang already has support for
>crc32 and adler32.  I thought I saw crc32 somewhere
>else as well.
>
>Theory and practice don't agree as much in practice
>as they do in theory, so it's worth having a look at
>"Performance of Checksums and CRCs over Real Data"
>by Jonathan Stone, Michael Greenwald, Craig Partridge,
>and Jim Hughes
>and at "Revisiting Fletcher and Adler Checksums"
>by Theresa Maxino, whose conclusions I found surprising.
>
>It all depends on what your data are like and what
>kinds of errors you plausibly need to protect against,
>really.
>
>
>
>
>------------------------------
>
>Message: 2
>Date: Mon, 6 Apr 2009 19:11:51 -0700 (PDT)
>From: ryeguy <>
>Subject: [erlang-questions] In a mnesia cluster, which node is
>	queried?
>To: 
>Message-ID:
>	<>
>Content-Type: text/plain; charset=ISO-8859-1
>
>If you have a mnesia table replicated on nodes A and B, how does node
>C (which does not contain a copy of the table) choose which table to
>execute a query on? Is it random?
>
>
>------------------------------
>
>Message: 3
>Date: Tue, 7 Apr 2009 01:07:40 +0200
>From: Camille Troillard <>
>Subject: [erlang-questions] Concurrent Processes and the Programming
>	Erlang	book
>To: 
>Message-ID:
>	<>
>Content-Type: text/plain; charset="iso-8859-1"
>
>Hello,
>
>The Programming Erlang book has a nice exercise at section 8.11. ?I'm
>sure?this problem must have been solved a billion times before, so I
>won't go too much into the details.
>
>"Write a ring benchmark. Create N processes in a ring. Send a message
>round the ring M times so that a total of N * M messages get sent.
>Time how long this takes for different values of N and M."
>
>Although it is written in the "Concurrent Programming" chapter, I
>wondered if this problem was really concurrent after all: ?the
>messages are sent to a ring of N processes, but it is not stated that
>shall be sent in parallel. ?So I decided to write a parallel version
>of this.
>Attached is an erlang module that will spawn a?ring of?N processes and
>send a total of M messages through it (that is N times N/M messages).
>To use it:
>
>rb:start(10, 10000).
>
>Will send 1000 messages 10 times in a 10 process ring. ?The result is
>a tuple containing timing informations.
>
>The results I have found are interesting in that it shows that Erlang
>starts to span the processing on multiple cores starting at 30
>processes. ?At this point, efficiency drops in favor of
>multiprocessing gaining efficiency back up to 1000 parallel processes.
>
>Also attached is a graph showing the time spent to send one message
>for a MacBook Pro (2 cores), a MacPro (4 cores) and a small Lenovo
>Ideapad S10 (2 cores) under Windows, which to my great surprise
>compares pretty well to the two former competitors. ?The comparison
>between each computer is indeed flawed for many reasons, but the shape
>of the graphs is interesting.
>
>I would be happy to know your feedback about the code, and please let
>me know if there is something wrong in my interpretation.
>
>
>Best Regards,
>Camille
>-------------- next part --------------
>A non-text attachment was scrubbed...
>Name: rb.erl
>Type: application/octet-stream
>Size: 4056 bytes
>Desc: not available
>Url : http://www.erlang.org/pipermail/erlang-questions/attachments/20090407/1ce97506/attachment.obj 
>-------------- next part --------------
>A non-text attachment was scrubbed...
>Name: Ring Bench Graph.png
>Type: image/png
>Size: 100422 bytes
>Desc: not available
>Url : http://www.erlang.org/pipermail/erlang-questions/attachments/20090407/1ce97506/attachment.png 
>
>------------------------------
>
>_______________________________________________
>erlang-questions mailing list
>
>http://www.erlang.org/mailman/listinfo/erlang-questions
>
>End of erlang-questions Digest, Vol 23, Issue 25
>************************************************




More information about the erlang-questions mailing list