Thread question
Steve Holle
sholle at link-comm.com
Fri Dec 10 23:57:38 UTC 2004
I'm having problems with a thread getting starved, I believe, and I'm
looking for some help on how to fix it. This is probably a threading 101
question but please stick with me.
I have two threads that never block, call them threads 1A and 1B, and are
defined as follows (with different names) :
rtems_status_code status = rtems_task_create( name,
100,
RTEMS_MINIMUM_STACK_SIZE * 2,
RTEMS_PREEMPT | RTEMS_TIMESLICE,
RTEMS_FLOATING_POINT | RTEMS_LOCAL,
&tid );
I have a number of other threads that block, call them 2A thru 2?, and are
defined similar to the following :
rtems_task_set_priority (RTEMS_SELF, RTEMS_CURRENT_PRIORITY, &my_priority_w);
sc = rtems_task_create (rtems_build_name ('S', 'A', 'S', 'W'),
my_priority_w,
8*1024,
RTEMS_PREEMPT | RTEMS_NO_TIMESLICE | RTEMS_NO_ASR |
RTEMS_INTERRUPT_LEVEL(0),
RTEMS_NO_FLOATING_POINT|RTEMS_LOCAL,
&tidw);
The latest thread I've added is a streaming audio thread and adds a fair
amount of overhead. Threads 1A and 1B run fine until I enable the
streaming audio thread at which point thread 1B stops responding. If I
only handle, say every tenth streaming audio sample thread 2A, 1B starts
working. And it's not a slow degradation but a sudden cutoff.
If I disable task 1A, 1B keeps running even with the streaming audio running.
I assumes that since 1A and 1B where set up to timeslice that whatever time
was left 1A and 1B would get serviced. That is obviously a false assumption.
Any ideas?
Steve Holle
Link Communications, Inc.
1035 Cerise Rd.
Billings, MT 59101
sholle at link-comm.com
More information about the users
mailing list