Hello,
I need some samples of using threads.
Need also specific solution for :
there are n threads in an array of thread,
each thread represent a value 1 to 100
(cyclic array, so thread-100 is the neighbour of thread-1).
First, I want to create the threads, each with a random value.
Second, as pseudo code (for thread_x) :
1) if value of thread_x < value the two neighbours value (together), then
increase the value of thread_x
2) if value of thread_x > value the two neighbours value (together), then
decrease the value of thread_x
3) if value of prev_thread <= value of thread_x <= value of next_thread
or
if value of next_thread <= value of thread_x <= value of prev_thread ,
then stay with no change.
every thead continue checking its value, till it won't change.
Need to present the text : each line will present a step.
Two possible solution :
simultaniusly do : initialize values, check the values, update the values,
or simultaniusly every thread check and update.
Thanks :)
Andy Dingley - 14 Jul 2006 10:39 GMT
> I need some samples of using threads.
Weren't you given some in class, before the teacher set the homework?
pcbutts1 - 14 Jul 2006 15:31 GMT
Probably not. My teachers use of English is worse then my knowledge of java.

Signature
The best live web video on the internet http://www.seedsv.com/webdemo.htm
NEW Embedded system W/Linux. We now sell DVR cards.
See it all at http://www.seedsv.com/products.htm
Sharpvision simply the best http://www.seedsv.com
>> I need some samples of using threads.
>
> Weren't you given some in class, before the teacher set the homework?