[Shootout-list] process creation & message passing
Isaac Gouy
igouy2@yahoo.com
Mon, 18 Oct 2004 12:11:02 -0700 (PDT)
chainmsg
- create a chain of 1000 processes/threads/...
- send message 0 to one end of the chain
- each process/thread/...
receives an integer x from previous process/thread,
buffer x,
passes x+1 to the next process/thread/...
- except last process/thread/...
receives an integer x from previous process/thread,
buffer x,
accumulates sum of message x values
: print sum (should be 1000 * m, show messages were not corrupted)
(1 parameter, m: how many 0 messages are sent to chain end)
scale by increasing number of messages sent.
chain
- create a chain of 1000 processes/threads/...
- destroy the chain of processes/threads/...
- repeat n times
: print 1000 (show program exited normally)
(1 parameter, n: how many create/destroy cycles)
scale by increasing number of create/destroy cycles.
_______________________________
Do you Yahoo!?
Declare Yourself - Register online to vote today!
http://vote.yahoo.com