seeplusplusnewbie
Programmer
I made a Multithreaded serial communication program (GUI Thread and Worker Thread) where the flow of data is continuous. Thus the way I have it is I use an Infinite loop of (Read data, do something with data and loopback to read more data in my worker thread), however this causes the cpu time to be completely used (99-100%). Now since the program is much faster then the flow of data what I want to do is: Read data, do something with it, then return to the OS then go back to the read routine and do it again so the cpu is used as minimally as possible.
How could I go about being able to recall the read function once I return to the OS without missing any data?
Does anyone have any advice or answers to my question?
Thanks
How could I go about being able to recall the read function once I return to the OS without missing any data?
Does anyone have any advice or answers to my question?
Thanks