tasks blocking
Ilya Alexeev
ilya at continuum.ru
Mon Dec 3 09:38:32 UTC 2001
Hi RTEMS users & developers.
Some time ago I wrote a similar letter but I have not received any answer so
far.
I am using gen68360 bsp & rtems-ss-20011025
and I have noticed the following problem:
When creating a task with RTEMS_INTERRUPT_LEVEL which is less than the
interrupt level of the Periodic Interrup Timer (PIT), then after calling
the directive rtems_task_wake_after this task may not wake up, the
probability being very high.
If we create the task with RTEMS_INTERRUPT_LEVEL greater or equal to
PIT interrupt level, the directive rtems_task_wake_after works "better";
however, there have been occasions when after several days of continuous
testing this task stopped forever.
What may this problem be caused by?
Here is the test I have been using.
//////////////// begin ////////////
rtems_task testTask(rtems_task_argument ignored)
{
while(1)
{
rtems_task_wake_after(1);
}
}
rtems_task Init(rtems_task_argument argument)
{
int i;
rtems_id tid;
puts("Test is running...");
for (i = 0; i < 10; i++)
{
rtems_task_create(rtems_build_name('T','S','K','0'+i),
10, RTEMS_MINIMUM_STACK_SIZE,
RTEMS_DEFAULT_MODES | RTEMS_INTERRUPT_LEVEL(0),
RTEMS_DEFAULT_ATTRIBUTES, &tid);
rtems_task_start(tid, testTask, 0);
}
while(1)
{
getchar();
CPU_usage_Dump();
}
}
//////////////// end ////////////
The getchar() function in Init doesn't block the testTasks and doesn't
influence test results.
No combination of task modes and task attributes influences test
results. Everything depends upon RTEMS_INTERRUPT_LEVEL.
Here are the results of CPU_usage_Dump() after some time of testing.
CPU Usage by thread
ID NAME TICKS
0x04010001 IDLE 11251
0x08010001 INIT 4523
0x08010002 TSK0 513
0x08010003 TSK1 31
0x08010004 TSK2 514
0x08010005 TSK3 37
0x08010006 TSK4 18
0x08010007 TSK5 18
0x08010008 TSK6 20
0x08010009 TSK7 32
0x0801000a TSK8 6217
0x0801000b TSK9 512
Ticks since last reset = 5823
Total Units = 23480
As you see, some tasks have lost their control very quickly.
I will be glad to receive any replies and ideas.
Ilya.
More information about the users
mailing list