View Full Version : Window manager in Windows, How I can solve this problem?

21st November 2013, 09:16
I'm developing an application that receives data from the com port. The data are continuously logged to a file on hard drive, lost data can not be allowed. I encountered the following problem when pinch a window, the main thread is blocked, and the data are no longer written to the file. How can I solve this problem? I try make a record in a separate thread, but it did not help because the data obtained in the main thread, which is drawn interface. If any solutions to this problem?

21st November 2013, 09:39
Have you moved both reading and writing to the secondary thread?

Does the thread interact with the main thread in any way?


21st November 2013, 10:49
Architecture classes next . There is the main class that creates a lot of others. Driver Class com port that receives the data and sends to the class that processes the data from the device , the class creates another class that is responsible for writing to a file . I try moved to a separate thread , only the object that writes to a file, but it does not produce results , unnecessarily blocking the main thread , I block to receive and process data. Move all in the other thread (receiving, processing and recording , I can not ) might interact architecture classes is not very good, and trying to do it, there are many errors.The only way to completely rewrite the entire project by dividing the drawing interface and work with data in different threads , but here there ability to make some complexity.Perhaps there any ways out of this situation?

21st November 2013, 12:30
Really, there was no sync transmitter - receiver physical layer?