Click here to Skip to main content
15,886,963 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionRe: Help with threads Pin
AndrewG12314-Sep-12 13:37
AndrewG12314-Sep-12 13:37 
AnswerRe: Help with threads Pin
pasztorpisti4-Sep-12 14:18
pasztorpisti4-Sep-12 14:18 
GeneralRe: Help with threads Pin
Joe Woodbury4-Sep-12 17:16
professionalJoe Woodbury4-Sep-12 17:16 
GeneralRe: Help with threads Pin
pasztorpisti4-Sep-12 22:33
pasztorpisti4-Sep-12 22:33 
GeneralRe: Help with threads Pin
Albert Holguin5-Sep-12 12:23
professionalAlbert Holguin5-Sep-12 12:23 
GeneralRe: Help with threads Pin
Richard MacCutchan4-Sep-12 22:06
mveRichard MacCutchan4-Sep-12 22:06 
QuestionRe: Help with threads Pin
David Crow5-Sep-12 3:15
David Crow5-Sep-12 3:15 
AnswerRe: Help with threads Pin
pasztorpisti5-Sep-12 3:31
pasztorpisti5-Sep-12 3:31 
Then the worker thread is waiting until the message is processed on the gui thread. Exploiting this you can for example pop up a messagebox from the worker thread by sending a WM_APP+X message to the gui thread that processes WM_APP+X and "blocks" until the message box is closed. The worker thread continues running only after the message box is closed and the processing of WM_APP+X is finished on the gui thread. I quoted "blocks" because a MessageBox call doesn't really block the gui thread, it just blocks the processing of a single message an it runs an inner messageloop of its own so processing other messages from the queue of the gui thread goes on. For example your windows are still drawn (by WM_PAINT messages) while a messagebox is active.
PS: The ui thread should never be blocked, that causes unresponsive UI. Often thats the reason for multithreading and not gaining performance. If your UI thread is blocked then your program is either buggy or poorly designed.
GeneralRe: Help with threads Pin
David Crow5-Sep-12 3:46
David Crow5-Sep-12 3:46 
GeneralRe: Help with threads Pin
pasztorpisti5-Sep-12 3:55
pasztorpisti5-Sep-12 3:55 
GeneralRe: Help with threads Pin
Albert Holguin5-Sep-12 12:26
professionalAlbert Holguin5-Sep-12 12:26 
AnswerRe: Help with threads Pin
Chuck O'Toole5-Sep-12 3:57
Chuck O'Toole5-Sep-12 3:57 
GeneralRe: Help with threads Pin
Albert Holguin5-Sep-12 12:25
professionalAlbert Holguin5-Sep-12 12:25 
AnswerRe: Help with threads Pin
Chuck O'Toole6-Sep-12 15:46
Chuck O'Toole6-Sep-12 15:46 
GeneralRe: Help with threads Pin
Albert Holguin7-Sep-12 3:54
professionalAlbert Holguin7-Sep-12 3:54 
QuestionRe: Help with threads Pin
AndrewG12315-Sep-12 9:55
AndrewG12315-Sep-12 9:55 
AnswerRe: Help with threads Pin
David Crow6-Sep-12 5:41
David Crow6-Sep-12 5:41 
QuestionRe: Help with threads Pin
AndrewG123111-Sep-12 11:33
AndrewG123111-Sep-12 11:33 
QuestionRe: Help with threads Pin
David Crow12-Sep-12 2:45
David Crow12-Sep-12 2:45 
GeneralRe: Help with threads Pin
AndrewG123112-Sep-12 6:21
AndrewG123112-Sep-12 6:21 
SuggestionRe: Help with threads Pin
David Crow12-Sep-12 8:17
David Crow12-Sep-12 8:17 
QuestionRe: Help with threads Pin
AndrewG123112-Sep-12 14:21
AndrewG123112-Sep-12 14:21 
AnswerRe: Help with threads Pin
David Crow13-Sep-12 3:47
David Crow13-Sep-12 3:47 
GeneralRe: Help with threads Pin
AndrewG123113-Sep-12 7:46
AndrewG123113-Sep-12 7:46 
GeneralRe: Help with threads Pin
David Crow13-Sep-12 7:55
David Crow13-Sep-12 7:55 

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.