|
-
April 1st, 2011, 03:43 PM
#1
Thread callback handling, best practices?
Hi
I have a worker-thread that send a callback WM_APP-message to the parent when finished.
(.... workerthread end...)
::SendMessage(hParent, WM_APP+101, NULL, NULL);
return 0;
}
In the parents messageloop we handle data from worker thread and want to create a new worker thread todo next job:
(.... messageloop in mainprogram ....)
if{message == WM_APP+101)
{
DWORD dwCode;
m_thread.Stop(dwCode); //Deadlock since CThread syncronize?
}
I'm currently using the CThread wrapper: http://www.codeproject.com/KB/threads/cthread.aspx
There much be a common practice to manage such scenario. What would you do, with or withour the CThread implementation?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|