Uncompleted thread with TimerTimeout in multi-thread program

Hello all,

I am using a multi-thread program that executes with a 20ms period. Within each period, a few task threads are scheduled to execute one by one. A TimerTimeout() is used for waiting each thread before calling pthread_cond_wait() function. With different assigned time, the TimerTimeout() can set the execution time bound for each thread. One question is that if a thread cannot finish within the assigned time in this period due to an accidental computation burden, then what will happen to the data within that thread? Thank you.

Regards,
Eric

if a thread cannot finish within the assigned time in this period due to an accidental computation burden, then what will happen to the data within that thread?

If TimerTimeout() timeout occurs, what action are you taking? Terminating the thread? Starting another and ignoring the overbudget thread?

If the over-budget thread exits, its resources remain locked in memory (zombie) UNLESS the thread is “detached”, or someone reads its return code.