[Shootout-list] process creation & message passing chain
Isaac Gouy
igouy2@yahoo.com
Fri, 5 Nov 2004 11:56:09 -0800 (PST)
Einar Karttunen's revision of the suggested 'chain' test leads the way
to simple process creation & message passing tests. (For some
languages, it will be straightforward to use the same code for both
tests.)
In my understanding, the intent of Einar Karttunen's revision was to
show that the program had indeed created N processes/threads and they
were all still alive - by the simple expedient of having each
process/thread increment a count message.
We measure process creation sending just one message (the count).
We measure message passing sending a lot of messages.
chain
=====
take 2 command line args N M (M for convenience)
create a chain of N processes/threads such that:
each process, thread...
can receive an integer message
can store the received message
knows the next process/thread in the chain
can send the integer message + 1 to the next process, thread...
the last process/thread... in the chain is different, it:
can receive an integer message
can store the received message
there is no next process/thread...
send the integer message 0 to the first process/thread
print the message received by the last process/thread
exit
chainmsg
========
mostly the same as chain, with these differences:
the last process/thread in the chain is different, it:
- can store the received message
+ can store the sum of received messages
- send the integer message 0 to the first process/thread
+ M times: send the integer message 0 to the first process/thread
- print the message received by the last process/thread
+ print the sum of messages received by the last process/thread
Notes
=====
With the integer message (and incremented values) there's a reasonable
chance that corrupt/missing messages will be detected. (I've already
seen that.)
In chainmsg the process creation / message passing ratio can be
adjusted to satisfy Bengt.
We still have to establish that on the test machine, the fast languages
have measurable times without requiring such a large N (number of
processes/threads) that other languages suffer "death by concurrency"
(to satisfy me).
In addition, using the chain programs to measure the maximum number of
processes/threads that can be created on the test machine, and
including those limits in the 'about' text seems fine to me.
__________________________________
Do you Yahoo!?
Check out the new Yahoo! Front Page.
www.yahoo.com