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?