J
johndesp
Hi.
I want to startup 3 threads which will access elements of a Vector and
perform an action based upon the value in the vector. I want to each
thread to get priority to the Vector to grab the next element in order
that the particular thread completed enacting on the previous Vector
element.
Forinstance, Assuming each thread gets started in order..
The first three elements of the vector would get executed in order
Thread 0 ==> element 0
Thread 1 ==> element 1
Thread 2 ==> element 2
However if Thread 1 finished before the others it would grab the next
vector element..
Thread 1 ==> element 3
Thread 2 ==> element 4
Thread 0 ==> element 5
I can get the threads started but thread 0 always seems to have a
"lock" on the Vector and the other threads can't get involved..
I would appreciate it if someone could provide a solution and perhaps
some psuedo code to make this happen. Like I said before I can get all
3 threads to start , but thread 0 hogs up the Vector...
thanks
I want to startup 3 threads which will access elements of a Vector and
perform an action based upon the value in the vector. I want to each
thread to get priority to the Vector to grab the next element in order
that the particular thread completed enacting on the previous Vector
element.
Forinstance, Assuming each thread gets started in order..
The first three elements of the vector would get executed in order
Thread 0 ==> element 0
Thread 1 ==> element 1
Thread 2 ==> element 2
However if Thread 1 finished before the others it would grab the next
vector element..
Thread 1 ==> element 3
Thread 2 ==> element 4
Thread 0 ==> element 5
I can get the threads started but thread 0 always seems to have a
"lock" on the Vector and the other threads can't get involved..
I would appreciate it if someone could provide a solution and perhaps
some psuedo code to make this happen. Like I said before I can get all
3 threads to start , but thread 0 hogs up the Vector...
thanks