Click here to Skip to main content
15,905,867 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Generalmultithreaded dialog problems Pin
DaveManGO24-Aug-05 4:20
DaveManGO24-Aug-05 4:20 
GeneralRe: multithreaded dialog problems Pin
David Crow24-Aug-05 4:26
David Crow24-Aug-05 4:26 
GeneralRe: multithreaded dialog problems Pin
DaveManGO24-Aug-05 4:31
DaveManGO24-Aug-05 4:31 
GeneralRe: multithreaded dialog problems Pin
David Crow24-Aug-05 5:22
David Crow24-Aug-05 5:22 
GeneralRe: multithreaded dialog problems Pin
DaveHuber24-Aug-05 8:08
DaveHuber24-Aug-05 8:08 
GeneralRe: multithreaded dialog problems Pin
David Crow24-Aug-05 8:18
David Crow24-Aug-05 8:18 
GeneralRe: multithreaded dialog problems Pin
DaveManGO25-Aug-05 4:43
DaveManGO25-Aug-05 4:43 
GeneralRe: multithreaded dialog problems Pin
David Crow25-Aug-05 4:52
David Crow25-Aug-05 4:52 
DaveHuber wrote:
Until all the threads are done, the main thread is sitting in a loop: print the message if there is one ready to be printed, Update the window, and sleep for a little while.

Ouch! This is not the way for a well-behaved multithreaded application to be. Anytime you have to use Sleep() to get the threads to work together, rest assured that there is a definite design problem. The secondary threads should post a message back to the main thread when they have something to report (e.g., started, processing, stopped). Have you read these two articles:

User Interface Threads
Worker Threads


"One must learn from the bite of the fire to leave it alone." - Native American Proverb



-- modifed at 11:22 Thursday 25th August, 2005
GeneralRe: multithreaded dialog problems Pin
DaveHuber25-Aug-05 5:09
DaveHuber25-Aug-05 5:09 
GeneralRe: multithreaded dialog problems Pin
David Crow25-Aug-05 5:28
David Crow25-Aug-05 5:28 
GeneralRe: multithreaded dialog problems Pin
DaveManGO25-Aug-05 5:57
DaveManGO25-Aug-05 5:57 
QuestionWireless? Pin
dandy7224-Aug-05 3:56
dandy7224-Aug-05 3:56 
AnswerRe: Wireless? Pin
David Crow24-Aug-05 4:20
David Crow24-Aug-05 4:20 
GeneralRe: Wireless? Pin
dandy7224-Aug-05 5:11
dandy7224-Aug-05 5:11 
GeneralRe: Wireless? Pin
David Crow24-Aug-05 5:25
David Crow24-Aug-05 5:25 
GeneralRe: Wireless? Pin
Ravi Bhavnani24-Aug-05 11:07
professionalRavi Bhavnani24-Aug-05 11:07 
GeneralCapturing HDC Pin
rocky_pulley24-Aug-05 3:43
rocky_pulley24-Aug-05 3:43 
GeneralRe: Capturing HDC Pin
emadns24-Aug-05 3:54
emadns24-Aug-05 3:54 
GeneralRe: Capturing HDC Pin
rocky_pulley24-Aug-05 4:18
rocky_pulley24-Aug-05 4:18 
GeneralRe: Capturing HDC Pin
Chris Losinger24-Aug-05 4:23
professionalChris Losinger24-Aug-05 4:23 
GeneralRadio button Pin
Nishad S24-Aug-05 1:23
Nishad S24-Aug-05 1:23 
GeneralRe: Radio button Pin
David Crow24-Aug-05 3:40
David Crow24-Aug-05 3:40 
QuestionRepresent font size..?? Pin
TssPrasad24-Aug-05 1:09
sussTssPrasad24-Aug-05 1:09 
AnswerRe: Represent font size..?? Pin
Nishad S24-Aug-05 1:41
Nishad S24-Aug-05 1:41 
Generalproblem of transfering file from one pc 2 another Pin
manishgandhi24-Aug-05 0:47
manishgandhi24-Aug-05 0:47 

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.