Click here to Skip to main content
15,887,434 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionRe: Thread paused Pin
CPallini18-Jan-10 1:39
mveCPallini18-Jan-10 1:39 
AnswerRe: Thread paused Pin
Covean18-Jan-10 1:57
Covean18-Jan-10 1:57 
AnswerRe: Thread paused Pin
xushih19-Jan-10 1:38
xushih19-Jan-10 1:38 
QuestionRe: Thread paused Pin
CPallini19-Jan-10 1:54
mveCPallini19-Jan-10 1:54 
AnswerRe: Thread paused Pin
Adam Roderick J18-Jan-10 0:18
Adam Roderick J18-Jan-10 0:18 
QuestionRe: Thread paused Pin
Covean18-Jan-10 1:02
Covean18-Jan-10 1:02 
GeneralRe: Thread paused Pin
susanne118-Jan-10 1:16
susanne118-Jan-10 1:16 
GeneralRe: Thread paused Pin
Covean18-Jan-10 1:49
Covean18-Jan-10 1:49 
I couldn't find any reason why your thread pauses for 3-5 seconds.
But your "main loop" is a kind of resource-eating.
Do you really meant to use a timeout of 0 to wait for this object?
0 timeout means to check the signaled state of the waitable handle
and to return immediately. So your loop will iterate very very fast and
consumes nearly 100% processing time.

UINT CMyThread::ThreadFunction(LPVOID param)
{
    while(!bTerminate) // bool bTerminate 
    {
        if ((::WaitForSingleObject(m_Sel_End_Event, 0) == WAIT_OBJECT_0))
        {
            bTerminate = true; 
            continue;
        } 
    }
}


But as I said before this doesn't solve your problem. Is there maybe more code you can provide?
By the way you also use the 0 timeout also in your ThreadStart function (but there it shouldn't be
a problem).

Greetings
Covean

QuestionObject in a Regular DLL Pin
Lazzari Patrizio17-Jan-10 22:20
Lazzari Patrizio17-Jan-10 22:20 
QuestionRe: Object in a Regular DLL Pin
Lazzari Patrizio17-Jan-10 22:23
Lazzari Patrizio17-Jan-10 22:23 
AnswerRe: Object in a Regular DLL Pin
Cedric Moonen17-Jan-10 22:32
Cedric Moonen17-Jan-10 22:32 
AnswerRe: Object in a Regular DLL Pin
KingsGambit17-Jan-10 22:33
KingsGambit17-Jan-10 22:33 
GeneralRe: Object in a Regular DLL Pin
Lazzari Patrizio17-Jan-10 22:35
Lazzari Patrizio17-Jan-10 22:35 
GeneralRe: Object in a Regular DLL Pin
KingsGambit17-Jan-10 23:03
KingsGambit17-Jan-10 23:03 
AnswerRe: Object in a Regular DLL Pin
Nelek17-Jan-10 22:37
protectorNelek17-Jan-10 22:37 
GeneralRe: Object in a Regular DLL Pin
Lazzari Patrizio17-Jan-10 22:48
Lazzari Patrizio17-Jan-10 22:48 
GeneralRe: Object in a Regular DLL Pin
CPallini17-Jan-10 22:56
mveCPallini17-Jan-10 22:56 
GeneralRe: Object in a Regular DLL Pin
Lazzari Patrizio17-Jan-10 22:58
Lazzari Patrizio17-Jan-10 22:58 
GeneralRe: Object in a Regular DLL Pin
CPallini17-Jan-10 23:03
mveCPallini17-Jan-10 23:03 
GeneralRe: Object in a Regular DLL Pin
Lazzari Patrizio17-Jan-10 23:06
Lazzari Patrizio17-Jan-10 23:06 
QuestionRe: Object in a Regular DLL Pin
CPallini17-Jan-10 23:12
mveCPallini17-Jan-10 23:12 
GeneralRe: Object in a Regular DLL Pin
Nelek17-Jan-10 23:43
protectorNelek17-Jan-10 23:43 
QuestionRe: Object in a Regular DLL Pin
CPallini17-Jan-10 22:52
mveCPallini17-Jan-10 22:52 
QuestionIAuthenticate - urgent help Pin
YaronNir17-Jan-10 20:52
YaronNir17-Jan-10 20:52 
AnswerRe: IAuthenticate - urgent help Pin
Garth J Lancaster17-Jan-10 22:22
professionalGarth J Lancaster17-Jan-10 22:22 

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.