Subj : Re: Killing threads To : comp.programming.threads From : David Schwartz Date : Tue Aug 16 2005 06:02 pm "Srini Palthepu" wrote in message news:43026977.3060905@Lucent.com... > How do a thread that is blocked doing the work > detect timeout? In my case, the main thread gets a > reset request from client upon timeout. > May be I can send an interrup signal instead of > SIGKILL to the thread. Set a 'timeout' flag on the client or job or whatever it is that timed out. Then have the thread that is doing the work check the 'timeout' flag at safe points in its processing. Don't say "I need to time out a thread" say "I need to stop processing this list of tasks if the client is no longer interested in the answer" or whatever. Threads are just ways to get work done, a thread is not the work it's doing. DS .