Click here to Skip to main content
15,921,113 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: user groups Pin
EpicYeti14-Nov-06 6:55
EpicYeti14-Nov-06 6:55 
AnswerRe: user groups Pin
Hamid_RT14-Nov-06 19:14
Hamid_RT14-Nov-06 19:14 
QuestionCPU Usage - 100% Pin
Programm3r14-Nov-06 6:21
Programm3r14-Nov-06 6:21 
AnswerRe: CPU Usage - 100% Pin
Anthony Mushrow14-Nov-06 6:34
professionalAnthony Mushrow14-Nov-06 6:34 
GeneralRe: CPU Usage - 100% Pin
Programm3r14-Nov-06 6:48
Programm3r14-Nov-06 6:48 
GeneralRe: CPU Usage - 100% Pin
Zac Howland14-Nov-06 10:18
Zac Howland14-Nov-06 10:18 
QuestionRe: CPU Usage - 100% Pin
Programm3r14-Nov-06 18:26
Programm3r14-Nov-06 18:26 
AnswerRe: CPU Usage - 100% Pin
Zac Howland15-Nov-06 4:57
Zac Howland15-Nov-06 4:57 
« Programm3r » wrote:
With these methods, can I still put all my code in the loop that one of these methods creates for example:


WaitForSingleObject(hHandle,INFINITE)
{
.... // rest of all the code to execute then a client(s) connects
}


It would depend on what you were doing (i.e. if you were waiting for multiple clients to connect before moving on, or were simply spawning a thread for each connection, yes).

As a rule of thumb, try to avoid using INFINITE as your timeout value. The reasoning is simple: if the event never occurs, the thread you are in is deadlocked. Generally, choose an appropriate timeout value and check the return value of WaitForXXX to see if it returned the timeout value (OBJECT_TIMEOUT if memory serves).

If you decide to become a software engineer, you are signing up to have a 1/2" piece of silicon tell you exactly how stupid you really are for 8 hours a day, 5 days a week

Zac

QuestionRe: CPU Usage - 100% Pin
Programm3r14-Nov-06 18:45
Programm3r14-Nov-06 18:45 
AnswerRe: CPU Usage - 100% Pin
Zac Howland15-Nov-06 5:01
Zac Howland15-Nov-06 5:01 
AnswerRe: CPU Usage - 100% Pin
Mark Salsbery14-Nov-06 6:43
Mark Salsbery14-Nov-06 6:43 
GeneralRe: CPU Usage - 100% Pin
Programm3r14-Nov-06 6:51
Programm3r14-Nov-06 6:51 
GeneralRe: CPU Usage - 100% Pin
Mark Salsbery14-Nov-06 6:54
Mark Salsbery14-Nov-06 6:54 
GeneralRe: CPU Usage - 100% Pin
Programm3r14-Nov-06 6:57
Programm3r14-Nov-06 6:57 
QuestionRe: CPU Usage - 100% Pin
David Crow14-Nov-06 6:51
David Crow14-Nov-06 6:51 
AnswerRe: CPU Usage - 100% Pin
Programm3r14-Nov-06 6:54
Programm3r14-Nov-06 6:54 
GeneralRe: CPU Usage - 100% Pin
Programm3r14-Nov-06 7:52
Programm3r14-Nov-06 7:52 
QuestionGetline() in thread Pin
Max++14-Nov-06 4:58
Max++14-Nov-06 4:58 
AnswerRe: Getline() in thread Pin
Cedric Moonen14-Nov-06 5:05
Cedric Moonen14-Nov-06 5:05 
AnswerRe: Getline() in thread Pin
Viorel.14-Nov-06 5:12
Viorel.14-Nov-06 5:12 
Answeruse <pre></pre> tags Pin
toxcct14-Nov-06 5:19
toxcct14-Nov-06 5:19 
Questionactivex with managed assembly Pin
Sandra197414-Nov-06 4:56
Sandra197414-Nov-06 4:56 
QuestionProblem in Owner Draw Button Pin
Parthi_Appu14-Nov-06 4:51
Parthi_Appu14-Nov-06 4:51 
AnswerRe: Problem in Owner Draw Button Pin
PJ Arends14-Nov-06 5:51
professionalPJ Arends14-Nov-06 5:51 
GeneralRe: Problem in Owner Draw Button Pin
Parthi_Appu14-Nov-06 17:20
Parthi_Appu14-Nov-06 17:20 

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.