Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

I need a suggestion for Win32 Timeout handling technique

Status
Not open for further replies.

Pizzadx

Programmer
Jan 23, 2002
1
VN
I have a Win32 application which has 1 main thread and 3 sub-threads created by that main thread.The main thread will ask its sub-threads to do some tasks paralelly with the request timeout(i.e if the time for sub-thread doing its tasks elapses the timeout value, the main thread will not wait and care the sub-thread's response value anymore).I use PostThreadMessage to post/receive the request/response and SetTimer with Callback function to handle the timeout case.However, with this technique, when the time is out, the sub-thread is still going on running its tasks without any timeout notice. Can anyone suggest me some ways for the sub-thread to know the timeout status and stop doing the task properly when the main thread doesn't need the response anymore?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top