开云体育

ctrl + shift + ? for shortcuts
© 2025 开云体育

Flushing the Incoming Message Buffer - C++ Multi-threading


 

I have a C++ GUI application which on which at a user request, the list of symbols will be cleared and all the market data requests will be cancelled, and ultimately the buffer holding the records for the GUI display is cleared.

The issue I have is that every now and again I get a crash because there are still incoming tick messages (price, volume, etc.) in the queue after the display and buffer are cleared.

Is there any way I can test the incoming message queue to see if there are any messages to process? Is there a way to clear that queue to prevent further GUI update calls from the reader thread?

Join [email protected] to automatically receive all group messages.