*i have a vb.net application that plots 16 plots immediately, the plots data are realtime. the 16 plots must draw the points at the time they receive them (must be no delay), to do that
1- i made a timer with ticks at 50 ms.
2- at each timer tick call the plotting function 16 times (with a graph name as parameter)like that:

        Draw(plot1)
        Draw(plot2)
        Draw(plot3)
        Draw(plot4)
        .
        .
        .

it made a big delay, when i used threading the application became unresponsive
can anyone help please??
THanKS,*

Can't you pass in the points as one data set rather than call it 16 times? You'd need to change your plotting function of course. How fast are new plot points generated (can you slow down the function call to match the incoming data)?
If it becomes unresponsive when use threading you most likely will be causing dealocks or race conditions. Without sample code we can't help you there.

How are the points being input to the program? Are they coming in on a serial port, file, etc?

hericles,
i tried to pass the point that will be drawn to a sub , that sub draws the point on all plots (at first, i was passing the plot name and the function plots a point on it and so on) but the performance didn't change better? i don't know what will happen if i tried threading

Reverend Jim,
the points is read in a list(Of Single) from a text file once at the startup of the program.

at an advanced time of the project the points will be received at realtime from a serial port? do you think the performance will decrease greatly when using the serial port? may i need threading???

Thanks All

I have never written a multi-threaded application under Windows (although I have written many on a SEL mainframe running MPX, but that's another animal entirely) but I think multi-threaded is the way to go. You could implement a queue (FIFO or First In First Out) structure where one thread would take data from the serial port and add it to the queue while another would remove data from the queue and plot it. You would not require timers so both threads could operate at full speed.

**Thanks very much, Reverend Jim, i will try this **

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.