Click here to Skip to main content
15,893,814 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: how to get info from stdio? Pin
includeh1030-Jun-02 21:06
includeh1030-Jun-02 21:06 
Generalfriend function problem ... Pin
Hadi Rezaee28-Jun-02 16:33
Hadi Rezaee28-Jun-02 16:33 
GeneralRe: friend function problem ... Pin
moswal28-Jun-02 17:46
moswal28-Jun-02 17:46 
GeneralMemory Context Memory Leak Pin
moswal28-Jun-02 16:08
moswal28-Jun-02 16:08 
GeneralCircular Queue Pin
JohnnyG28-Jun-02 14:55
JohnnyG28-Jun-02 14:55 
GeneralRe: Circular Queue Pin
Ancient Dragon28-Jun-02 15:28
Ancient Dragon28-Jun-02 15:28 
GeneralRe: Circular Queue Pin
subtractive30-Jun-02 7:28
subtractive30-Jun-02 7:28 
GeneralRe: Circular Queue Pin
JohnnyG30-Jun-02 12:53
JohnnyG30-Jun-02 12:53 
Thanks, guys for the suggestions. I think I have it done now. I still need to test it with a max load of data. I kept my buffers kind of small because of the application. I wanted to timestamp each 8, 14, or 32 byte message with a unique timestamp in msecs. However, legacy software only supports resolution to 10ths of a second.

Consequently, I used a small receive buffer of 128 bytes and a circular buffer of 1024 bytes. Though, I won't be able to maintain the millisecond accuracy, it should be fine for 10ths of a second.

I wrote it so that the read thread calls SetEvent() in which the process thread waits infinitely for. So, it doesn't poll and only gets used if there is data to process.

I found a pretty good example online of a C++ class that implemented a circular queue and I converted it to C. The thing I like about this one is that the front or head is always one position less then where the data actually begins making it easier to detect when the queue is full. Of course, that means one element in the queue is not used or 1023 of 1024 elements are used.

And as one of you wrote, I decided to discard any data if the processing thread couldn't keep up.

I'm still experimenting around but as its set up now the read thread is at a priority of 15 while the process thread is set to 15 when WaitingForMultipleObjects() but 17 when it gets control. Do you guys have any advice on this or does that sound normal?

Thanks again.
GeneralOpaque Label Controls Pin
AndyO28-Jun-02 14:45
AndyO28-Jun-02 14:45 
GeneralWinCE Help Files Pin
Mel Stober28-Jun-02 12:27
Mel Stober28-Jun-02 12:27 
GeneralRe: WinCE Help Files Pin
Anders Molin29-Jun-02 3:03
professionalAnders Molin29-Jun-02 3:03 
GeneralMulti language Pin
orcun colak28-Jun-02 11:51
orcun colak28-Jun-02 11:51 
GeneralRe: Multi language Pin
Scott H. Settlemier29-Jun-02 6:20
Scott H. Settlemier29-Jun-02 6:20 
GeneralMessageBox problem - only flashes Pin
David Viggiano28-Jun-02 10:38
David Viggiano28-Jun-02 10:38 
GeneralRe: MessageBox problem - only flashes Pin
Jason Henderson28-Jun-02 16:24
Jason Henderson28-Jun-02 16:24 
GeneralHelp me>>>>>>>>>>>>>>>> Pin
Michael Liu28-Jun-02 8:36
Michael Liu28-Jun-02 8:36 
GeneralRe: Help me>>>>>>>>>>>>>>>> Pin
Mike Nordell28-Jun-02 8:46
Mike Nordell28-Jun-02 8:46 
GeneralRe: Help me>>>>>>>>>>>>>>>> Pin
Jason Henderson28-Jun-02 16:23
Jason Henderson28-Jun-02 16:23 
GeneralRe: Help me>>>>>>>>>>>>>>>> Pin
Christopher Lord28-Jun-02 20:45
Christopher Lord28-Jun-02 20:45 
GeneralProblem with Buttons in Child Windows Pin
AndyO28-Jun-02 7:34
AndyO28-Jun-02 7:34 
GeneralOnly one column in reportview listcontrol Pin
ns28-Jun-02 6:44
ns28-Jun-02 6:44 
GeneralRe: Only one column in reportview listcontrol Pin
Mike Nordell28-Jun-02 8:38
Mike Nordell28-Jun-02 8:38 
GeneralRe: Only one column in reportview listcontrol Pin
ns28-Jun-02 8:57
ns28-Jun-02 8:57 
GeneralRe: Only one column in reportview listcontrol Pin
Shog928-Jun-02 10:23
sitebuilderShog928-Jun-02 10:23 
QuestionHow to remove the title bar from CFormView in MDI? Pin
ns28-Jun-02 6:31
ns28-Jun-02 6:31 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.