[Shootout-list] process creation & message passing
Isaac Gouy
igouy2@yahoo.com
Mon, 18 Oct 2004 09:38:47 -0700 (PDT)
> > 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.
Not spawn_link
All I mean by linked is that there's a sequence of processes.
In the Java example, each thread holds a reference to the "next"
thread, so just holding the Pid of the "next" process would be fine.
> > - 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?
correct. (We need to demonstrate that all messages were delivered.)
> > (1 parameter: how many messages are sent)
> do you mean sent from the first process, or from all processes?
>From the first process.
(1000 processes would be better - easier to complete a high-message
ratio 200:1 in a reasonable time.)
_______________________________
Do you Yahoo!?
Declare Yourself - Register online to vote today!
http://vote.yahoo.com