Nevermind. I found a better solution. I used shared memory to create a keep-alive flag. I then use the select function with a specified timeout, and recheck the keep-alive flag after each timeout. Thanx for all the input.