gen68360: tasks blocking

Ilya Alexeev ilya at continuum.ru
Thu Nov 15 13:07:50 UTC 2001


Hi all.

To gen68360 users:

I have created a set of tasks,
which are calling rtems_task_wake_after directive.
If the interrupt level of this tasks lower than
PIT interrupt level, then in some little time they become blocked,
i.e. scheduler does not get CPU time to them.
If the interrupt level of this tasks >= PIT interrupt level
then everything is fine.
Is this situation is correct or it is a bug in RTEMS?

Simple example to demonstrate this:


init.c:
~~~~~~~

#include <rtems.h>
#include <rtems/cpuuse.h>
#include <stdio.h>
#include "system.h"


rtems_task fakeTask(rtems_task_argument argument)
{ 
    while(1)
    {
        rtems_task_wake_after(1);
    } 
}


rtems_task Init(rtems_task_argument argument)
{
    rtems_id tid;
    int i;

    puts("\nStarting test...");
     
    for (i = 0; i < 10; i++)
    { 
        rtems_task_create(rtems_build_name('F','A','K','E'), 50,
            RTEMS_MINIMUM_STACK_SIZE, 
            RTEMS_DEFAULT_MODES |
            RTEMS_INTERRUPT_LEVEL(0),  /* < 4 - task blocks; >= 4 - all is OK 
*/ 
            RTEMS_DEFAULT_ATTRIBUTES, &tid);
        rtems_task_start(tid, fakeTask, 0); 
    }
     
    while(1)
    { 
        getchar();
        CPU_usage_Dump();     /* to see tasks's CPU usage */ 
    }
     
    rtems_task_delete (RTEMS_SELF);
}
 

 
system.h:
~~~~~~~~~ 

#ifndef __SYSTEM_H_ 
#define __SYSTEM_H_
 
rtems_task Init(rtems_task_argument);
 
#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
 
#define CONFIGURE_MAXIMUM_SEMAPHORES                    10
#define CONFIGURE_MAXIMUM_TASKS                         10 

#define CONFIGURE_MICROSECONDS_PER_TICK                 1000 

#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER 
#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
 
#define CONFIGURE_INIT
 
#include <confdefs.h>
 
#endif  /* __SYSTEM_H_ */
 

 
Bye,
    Ilya.



More information about the users mailing list