Click here to Skip to main content
15,891,423 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: What is this called? Pin
Waldermort11-Feb-08 9:34
Waldermort11-Feb-08 9:34 
GeneralRe: What is this called? Pin
Mark Salsbery11-Feb-08 9:38
Mark Salsbery11-Feb-08 9:38 
AnswerRe: What is this called? Pin
krmed11-Feb-08 10:24
krmed11-Feb-08 10:24 
AnswerRe: What is this called? Pin
Michael Martin11-Feb-08 16:20
professionalMichael Martin11-Feb-08 16:20 
QuestionPostMessage failure. How best to proceed? Pin
Chris Meech11-Feb-08 8:38
Chris Meech11-Feb-08 8:38 
AnswerRe: PostMessage failure. How best to proceed? Pin
Nemanja Trifunovic11-Feb-08 8:50
Nemanja Trifunovic11-Feb-08 8:50 
GeneralRe: PostMessage failure. How best to proceed? Pin
Chris Meech11-Feb-08 9:48
Chris Meech11-Feb-08 9:48 
AnswerRe: PostMessage failure. How best to proceed? Pin
Mark Salsbery11-Feb-08 9:11
Mark Salsbery11-Feb-08 9:11 
Bleh - Sleep()  Dead | X|

I'd definitely recommend using a better synchronization method.

If there's potentially that much data coming in, implementing your own FIFO queue
and not posting a message for every item should work much better.

For example - At a minimum, you could synchronize access to the FIFO queue using a critical section.

The worker thread can enter the critical section, queue an item (or several items), post  the message, and leave the
critical section.

When the UI thread receives the message, it enters the critical section, processes all the queued items,
flushes all remaining user messages in the thread queue, and leaves the critical section.

That's a bare minimum, and if the data comes fast enough on the worker thread, it could still fill
the UI thread message queue, but hopefully it gives you an idea to work with.

Mark



Mark Salsbery
Microsoft MVP - Visual C++

Java | [Coffee]

GeneralRe: PostMessage failure. How best to proceed? Pin
Chris Meech11-Feb-08 9:53
Chris Meech11-Feb-08 9:53 
GeneralRe: PostMessage failure. How best to proceed? Pin
Cedric Moonen11-Feb-08 20:24
Cedric Moonen11-Feb-08 20:24 
GeneralRe: PostMessage failure. How best to proceed? Pin
Mark Salsbery12-Feb-08 5:32
Mark Salsbery12-Feb-08 5:32 
QuestionAuto-byte-swapping that can be used in a union [modified] Pin
ClementsDan11-Feb-08 6:56
ClementsDan11-Feb-08 6:56 
GeneralRe: Auto-byte-swapping that can be used in a union [modified] Pin
Mark Salsbery11-Feb-08 7:29
Mark Salsbery11-Feb-08 7:29 
GeneralRe: Auto-byte-swapping that can be used in a union Pin
led mike11-Feb-08 7:47
led mike11-Feb-08 7:47 
GeneralRe: Auto-byte-swapping that can be used in a union Pin
Mark Salsbery11-Feb-08 7:52
Mark Salsbery11-Feb-08 7:52 
GeneralDb query failing in MFC Pin
krishnan.s11-Feb-08 4:51
krishnan.s11-Feb-08 4:51 
GeneralAnd the errors are? Pin
jhwurmbach11-Feb-08 4:56
jhwurmbach11-Feb-08 4:56 
GeneralRe: And the errors are? Pin
krishnan.s11-Feb-08 4:59
krishnan.s11-Feb-08 4:59 
GeneralRe: And the errors are? Pin
krishnan.s11-Feb-08 5:00
krishnan.s11-Feb-08 5:00 
GeneralRe: And the errors are? Pin
jhwurmbach11-Feb-08 5:07
jhwurmbach11-Feb-08 5:07 
GeneralRe: Db query failing in MFC Pin
led mike11-Feb-08 5:08
led mike11-Feb-08 5:08 
GeneralRe: Db query failing in MFC Pin
krishnan.s11-Feb-08 17:33
krishnan.s11-Feb-08 17:33 
GeneralRe: Db query failing in MFC Pin
led mike12-Feb-08 5:34
led mike12-Feb-08 5:34 
Questionhow to add separator in list box Pin
coding_ram11-Feb-08 2:41
coding_ram11-Feb-08 2:41 
AnswerRe: how to add separator in list box Pin
David Crow11-Feb-08 2:56
David Crow11-Feb-08 2:56 

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.