Click here to Skip to main content

C / C++ / MFC

   

 
You must Sign In to use this message board. (secure sign-in)
 
Search this forum  
 FAQ
    Noise  Layout  Per page  Show 
  Refresh
GeneralRe: Best way to check if a thread is still active c++ win32 Pinmember Randor 16:55 21 Feb '12  
GeneralRe: Best way to check if a thread is still active c++ win32 Pinmemberjkirkerx17:05 21 Feb '12  
AnswerRe: Best way to check if a thread is still active c++ win32 PinmemberChuck O'Toole14:29 21 Feb '12  
GeneralRe: Best way to check if a thread is still active c++ win32 Pinmemberjkirkerx15:28 21 Feb '12  
AnswerRe: Best way to check if a thread is still active c++ win32 PinmemberChuck O'Toole16:12 21 Feb '12  
AnswerComplete code for CreateProcess and loop Pinmemberjkirkerx15:26 21 Feb '12  
AnswerRe: Complete code for CreateProcess and loop PinmemberChuck O'Toole16:22 21 Feb '12  
Well, the call inside the loop is pretty useless but if it makes you happy...
 
The sole purpose, as written, is to cause the big while loop to break out if the response is anything but "still running". But the WaitForSingleObject() returning anything other than "WAIT_TIMEOUT" (that is, WAIT_OBJECT_0) also breaks out of the loop (the "else clause") which will happen as soon as the thread stops running (which sets the exit code and signals the hProcess object).
 
Now, I'll grant you that by having the call at the bottom of the while loop may cause you to notice the process termination a couple of microseconds earlier than if you went to the top of the loop but you counter act that miniscule gain by discarding the status you might have received then and issue another GetExitCodeProcess() immediately upon exiting the while loop.
 
So, it adds nothing to the code, adds processing at each iteration. But, like I said, if it makes you happy ....
AnswerRe: Complete code for CreateProcess and loop PinmemberChuck O'Toole16:34 21 Feb '12  
GeneralRe: Complete code for CreateProcess and loop Pinmemberjkirkerx16:50 21 Feb '12  
GeneralRe: Complete code for CreateProcess and loop Pinmember Randor 17:08 21 Feb '12  
GeneralRe: Complete code for CreateProcess and loop Pinmemberjkirkerx18:18 21 Feb '12  
GeneralRe: Complete code for CreateProcess and loop Pinmemberjkirkerx6:58 22 Feb '12  
QuestionDynamic linking vs dynamic loading Pinmemberelelont24:47 21 Feb '12  
QuestionRe: Dynamic linking vs dynamic loading PinmemberDavidCrow5:41 21 Feb '12  
AnswerRe: Dynamic linking vs dynamic loading PinPopularmemberChris Losinger5:47 21 Feb '12  
QuestionHow to increase concurrent rate of a server application Pingroupyu-jian3:30 21 Feb '12  
AnswerRe: How to increase concurrent rate of a server application PinmvpRichard MacCutchan5:20 21 Feb '12  
AnswerRe: How to increase concurrent rate of a server application [modified] Pinmember Randor 8:32 21 Feb '12  
QuestionWin7 - worker thread freeze on call to WaitForSingleObject PinmemberStan the man0:12 21 Feb '12  
AnswerRe: Win7 - worker thread freeze on call to WaitForSingleObject PinmemberJochen Arndt0:29 21 Feb '12  
GeneralRe: Win7 - worker thread freeze on call to WaitForSingleObject PinmemberStan the man1:31 21 Feb '12  
AnswerRe: Win7 - worker thread freeze on call to WaitForSingleObject Pinmemberbjorn_ht1:16 21 Feb '12  
AnswerRe: Win7 - worker thread freeze on call to WaitForSingleObject PinmemberErudite_Eric2:31 21 Feb '12  
QuestionInitializing base class data PinmemberSunilKrSingh3:46 20 Feb '12  
AnswerRe: Initializing base class data Pinmemberprasad_som6:49 20 Feb '12  

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

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


Advertise | Privacy | Mobile
Beta | 2.5.120517.1 | Last Updated 22 May 2012
Copyright © CodeProject, 1999-2012
All Rights Reserved. Terms of Use
Layout: fixed | fluid