Skip navigation.
Home
The QNX Community Portal

View topic - Uncompleted thread with TimerTimeout in multi-thread program

Uncompleted thread with TimerTimeout in multi-thread program

For discussion of realtime and/or embedded programming.

Uncompleted thread with TimerTimeout in multi-thread program

Postby Ericxx » Tue Jan 22, 2013 2:39 pm

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
Ericxx
Senior Member
 
Posts: 158
Joined: Mon Jun 09, 2008 1:38 pm

Re: Uncompleted thread with TimerTimeout in multi-thread pro

Postby denkelly » Tue Jan 22, 2013 4:37 pm

>>>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.
denkelly
Senior Member
 
Posts: 160
Joined: Sat Aug 02, 2008 3:27 pm


Return to Realtime and Embedded

Who is online

Users browsing this forum: No registered users and 4 guests

cron