Home > other >  Qt PC serial communication qcustomplot graphics drawing program feign death after 80000 points
Qt PC serial communication qcustomplot graphics drawing program feign death after 80000 points

Time:10-23

Using qt wrote a host machine, a machine under every 1 ms to send data, the child thread serial data signal is sent to the GUI thread, GUI drawing, but drawing 80000 points, after application to feign death, if the machine send data every 10 ms, program will not feign death, is there a big help to solve, thank you

CodePudding user response:

Send data stack overflow, 1 ms, GUI thread too late or too late processing, result in buffer overflow or stack overflow?

CodePudding user response:

The difference of 1 ms and 10 ms sends data mean? Insist on 1 ms?

CodePudding user response:

reference 1st floor Lenged_Zhao response:
stack overflow, 1 ms to send data, the GUI thread too late or too late processing, result in buffer overflow or stack overflow?


10 ms send data, receive can reach more than 20, use customPlot - & gt; Graph (0) - & gt; AddData (), how to check whether the overflow

CodePudding user response:

refer to the second floor worldy response:
1 ms and the difference of 10 ms sends data mean? Insist on 1 ms?


Business requirements, real-time requirements

CodePudding user response:

reference 3 floor ㄨ pure ツ ギ hatred response:
Quote: reference 1st floor Lenged_Zhao response:
stack overflow, 1 ms to send data, GUI thread too late or too late processing, result in buffer overflow or stack overflow?


10 ms send data, receive can reach more than 20, use customPlot - & gt; Graph (0) - & gt; AddData (), how to check whether the overflow


This involves some thread calls, want to know how the thread is not really a parallel, but time into small pieces, each thread according to the priority of wheel to perform, so that you may be, you send the thread to 1 ms sends a data, the GUI thread in this time of 1 ms has not turn to perform or time it performs not over 1 ms, and then the CPU is cut out to perform other threads, then the next time the data has been accumulated, more will overflow, and the interval of 10 ms sends data, makes has a lot to finish may perform a GUI thread data processing,

CodePudding user response:

reference 5 floor Lenged_Zhao reply:
Quote: refer to the third floor ㄨ pure ツ ギ hatred response:
Quote: refer to 1st floor Lenged_Zhao response:
stack overflow, 1 ms to send data, the GUI thread too late or too late processing, result in buffer overflow or stack overflow?


10 ms send data, receive can reach more than 20, use customPlot - & gt; Graph (0) - & gt; AddData (), how to check whether the overflow


This involves some thread calls, want to know how the thread is not really a parallel, but time into small pieces, each thread according to the priority of wheel to perform, so that you may be, you send the thread to 1 ms sends a data, the GUI thread in this time of 1 ms has not turn to perform or time it performs not over 1 ms, and then the CPU is cut out to perform other threads, then the next time the data has been accumulated, more will overflow, and the interval of 10 ms sends data, makes has a lot to finish may perform a GUI thread data processing,


Is there any way to tune or monitoring whether overflow

CodePudding user response:

refer to 6th floor ㄨ pure ツ ギ hatred response:
Quote: refer to the fifth floor Lenged_Zhao reply:
Quote: refer to the third floor ㄨ pure ツ ギ hatred response:
Quote: refer to 1st floor Lenged_Zhao response:
stack overflow, 1 ms to send data, the GUI thread too late or too late processing, result in buffer overflow or stack overflow?


10 ms send data, receive can reach more than 20, use customPlot - & gt; Graph (0) - & gt; AddData (), how to check whether the overflow


This involves some thread calls, want to know how the thread is not really a parallel, but time into small pieces, each thread according to the priority of wheel to perform, so that you may be, you send the thread to 1 ms sends a data, the GUI thread in this time of 1 ms has not turn to perform or time it performs not over 1 ms, and then the CPU is cut out to perform other threads, then the next time the data has been accumulated, more will overflow, and the interval of 10 ms sends data, makes has a lot to finish may perform a GUI thread data processing,


Is there any way to tune or monitoring whether overflow ah

I didn't using QT development, according to the experience as a embedded time:
1, thread priority is adjusted, the GUI thread priority raised, can ease some, and design the thread lock, safeguard the GUI thread can be performed,
2, adjust the data logic, design a circular storage area (may according to some data loss), or use a mailbox, the signal transmission of data, send before the start of testing whether the email is full, is responsible for waiting,
3, in the thread of sending data direct call GUI program, eliminate thread calls,
  • Related