[Shootout-list] process creation & message passing

Bengt Kleberg bengt.kleberg@ericsson.com
Mon, 18 Oct 2004 13:57:45 +0200


Isaac Gouy wrote:
> chainmsg 
> - create 3000 *linked* processes/threads/... 

if you explain what you mean with link i will see if i can do this in 
another language.


> - send message 0 from one end of the chain
> - each process/thread/... receives an integer x, stores x, 
> and passes x+1 to the next process/thread/... in the chain
> : print the final sum (which should be 3000 * messages)

what should the last process is the chain do with the message? if the 
final sum is (3000 * messages) and we always send 0 from the first 
process i think the final process will have to accumulate the message 
contents. correct?

 > (1 parameter: how many messages are sent)

do you mean sent from the first process, or from all processes?


bengt