View Single Post
Join Date: Dec 2008
Posts: 22
Reputation: GadiK is an unknown quantity at this point 
Solved Threads: 0
GadiK GadiK is offline Offline
Newbie Poster

Re: reading from serial port way too slow (C++)

 
0
  #7
Dec 17th, 2008
okay, just wanted to let you know that I've worked things out.
Your tips were helpful so thank you very much.

I'll explain what I did so that others with a similar problem would try it.
Instead of trying to capture every data package that is sent, I waited 'till there were 5 packages and then read all of them into my working buffer (which was basically an array of chars with the appropriate size). After I rewrote my thread to work like this, the CPU usage dropped down to almost none.
I tried using my thread reading a single package at a time, and it worked great!

So, again, thanks everyone
And have a good and happy new year.
Reply With Quote