Hi,
I use OpenNetCF.IO.Port class in my data collecting application running on windows ce with the data stored using SQLCE 3.1 on a CF card. The main application have multiple threads running for collecting data from serial port, inserting the data into the database and also launch another executable upon user request which export the data from the database into a bunch of text files in removable media (SD card/USB thumb drive).
When the second executable is not running, so the application only runs the data collecting and database insert, the application runs fine, there are no serial port buffer overrun reported.
But as soon as the second executable is running which took 100% CPU load doing database reading and writing into text files, the main application started to get buffer overrun error.
I have played with the text files writing thread priority and set it to below normal priority, but it does not help much, lowering the priority reduce the amount of errors but the buffer overrun error still remain.
The only solution I got right now is by putting Thread.Sleep(0) command after each row read from database but this approach really hurt the data export performance.
Is there anyway we can prevent buffer overrun error under heavy I/O load?
I'm using .NET CF 2.0, the serial port is set at 19200 baud rate, 7 bit data, 1 stop bit, and odd parity. The hardware that send the data doesn't have handshake capability. Also the database file can be quite large, in the most extreme case I need to export more than 3 million rows of data into text files.
Thanks in advance,
Luthfi