Rather than terminating the thread, another approach would be to create a exit event (shared between both threads). With this approach, the secondary thread would periodically check to see if the event was set and exit if necessary. The primary thread (i.e. the controlling thread) would set this event when appropriate. As a backup, the primary thread could still terminate the thread if it fails to respond to the exit event. In general terminate thread should only be used as a last resort.

Arjay