Click here to Skip to main content
16,012,468 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Thread execution on button press suggestion Pin
cp987610-Apr-07 1:25
cp987610-Apr-07 1:25 
GeneralRe: Thread execution on button press suggestion Pin
J.B.10-Apr-07 1:37
J.B.10-Apr-07 1:37 
AnswerRe: Thread execution on button press suggestion Pin
Roger Stoltz10-Apr-07 1:48
Roger Stoltz10-Apr-07 1:48 
GeneralRe: Thread execution on button press suggestion Pin
David Crow10-Apr-07 2:10
David Crow10-Apr-07 2:10 
GeneralRe: Thread execution on button press suggestion Pin
Stephen Hewitt10-Apr-07 17:52
Stephen Hewitt10-Apr-07 17:52 
GeneralRe: Thread execution on button press suggestion Pin
cp987610-Apr-07 2:18
cp987610-Apr-07 2:18 
GeneralRe: Thread execution on button press suggestion Pin
Stephen Hewitt10-Apr-07 17:49
Stephen Hewitt10-Apr-07 17:49 
GeneralRe: Thread execution on button press suggestion Pin
Roger Stoltz10-Apr-07 21:58
Roger Stoltz10-Apr-07 21:58 
I admit I have used ::MsgWaitForMultipleObjects(...) in the way you're referring to a couple of times. But those cases were very specific.
You can also get in trouble with re-entrancy with Chaos and Mayhem following if you're not careful. There was nothing in J.B.'s post that implied to me that this could be such a rare case, that's why I suggested the most common, straight-forward and less error prone way to do it.

I also think you're missing my point Steve.
I wrote that "the implementation misses the point of multithreading" referring to J.B.'s call to ::WaitForSingleObject(...) blocking the main thread during the wait. In that situation he would actually gain on doing the worker thread task in the main thread.
I intentionally phrased it that way leaving the possibilities open for the rare cases you're thinking about, even though I doubt this would be one of them.


"It's supposed to be hard, otherwise anybody could do it!" - selfquote
"High speed never compensates for wrong direction!" - unknown

GeneralRe: Thread execution on button press suggestion Pin
J.B.10-Apr-07 20:59
J.B.10-Apr-07 20:59 
GeneralRe: Thread execution on button press suggestion Pin
Roger Stoltz10-Apr-07 21:39
Roger Stoltz10-Apr-07 21:39 
GeneralRe: Thread execution on button press suggestion Pin
J.B.21-Apr-07 23:58
J.B.21-Apr-07 23:58 
GeneralRe: Thread execution on button press suggestion Pin
Roger Stoltz22-Apr-07 9:50
Roger Stoltz22-Apr-07 9:50 
AnswerRe: Thread execution on button press suggestion Pin
Stephen Hewitt10-Apr-07 17:43
Stephen Hewitt10-Apr-07 17:43 
Questionhow to differenciate send mail and Reply Mail - webdav ? Pin
ArunkumarSundaravelu10-Apr-07 0:28
ArunkumarSundaravelu10-Apr-07 0:28 
QuestionHow to relate sent Item mail and Inbox mail in webdav method Pin
ArunkumarSundaravelu10-Apr-07 0:26
ArunkumarSundaravelu10-Apr-07 0:26 
QuestionHow to set the ConversationIndex Property ? Pin
ArunkumarSundaravelu10-Apr-07 0:20
ArunkumarSundaravelu10-Apr-07 0:20 
QuestionWindow handle which lost input focus Pin
K Gupta10-Apr-07 0:07
K Gupta10-Apr-07 0:07 
AnswerRe: Window handle which lost input focus Pin
Arman S.10-Apr-07 0:36
Arman S.10-Apr-07 0:36 
AnswerRe: Window handle which lost input focus Pin
John R. Shaw10-Apr-07 0:56
John R. Shaw10-Apr-07 0:56 
GeneralRe: Window handle which lost input focus Pin
David Crow10-Apr-07 2:14
David Crow10-Apr-07 2:14 
GeneralRe: Window handle which lost input focus Pin
John R. Shaw10-Apr-07 3:26
John R. Shaw10-Apr-07 3:26 
GeneralRe: Window handle which lost input focus Pin
K Gupta10-Apr-07 4:10
K Gupta10-Apr-07 4:10 
GeneralRe: Window handle which lost input focus Pin
John R. Shaw10-Apr-07 6:24
John R. Shaw10-Apr-07 6:24 
QuestionRe: Window handle which lost input focus Pin
Rajesh R Subramanian10-Apr-07 21:57
professionalRajesh R Subramanian10-Apr-07 21:57 
AnswerRe: Window handle which lost input focus Pin
K Gupta11-Apr-07 4:03
K Gupta11-Apr-07 4:03 

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.