> I am making a program which contains 10 parallel while loops.Each of
> the while loops contains an Intensity Graph (Waterfall) which updates
> at a different rate.The problem is, I have to bring data (array) into
> the while loop.the data is received from the network using the TCP
> Read function.But when I wire the array into the while loop, it is not
> functtioning properly and creates problems.how can I bring the array
> into the while loop?Can anybody help?
I have a feeling that you intend for your ten loops to be fed from an
eleventh parallel loop that is servicing the TCP connection. If this is
the case, then you will need to have a way for them to communicate that
doesn't wire them together.
The best way to do this is probably to make ten queues
with unique
names. As the TCP loop produces data, it puts the data in the
appropriate queue. Each loop reads from its own queue, meaning that it
blocks or blocks with a timeout waiting for new data. You will also
need a Boolean that the ten loops read from, proably using local variables.
If you would like something simpler, then put your ten intensity charts
in the same loop that you do the TCP stuff in. Put the chart terminals
inside of a case statement so that you can select when they get new
data. Some loop iterations will update nothing, others will update a
particular chart, whichever one the TCP packet was for. Anyway, without
going into tons of detail, this is a good alternative that you might
find simpler to debug.
Have fun.
Greg McKaskle