Fwd: RTEMS core: bad work with _Watchdog_* ?

Ilya Alexeev ilya at continuum.ru
Mon Feb 4 14:52:52 UTC 2002


Hi all.
I has tried to send this message only to Joel,
but I has received a returned mail with something about that domain isn't in
a list of allowed rcpthosts... So I send this to rtems-users...
------------------------------------

I am using the latest RTEMS snapshot and
see such effect:

Then I create very many tasks which are calling
rtems_task_wake_after in the infinite loop, there is a very big chance
that such task isn't wake up.

I am using the gen68360 bsp.

Here is the application which I use for test:

////////////////// begin of application //////////////////////////
#include <rtems.h>
#include <termios.h>
#include <stdio.h>
#include <rtems/libio.h>
#include <fcntl.h>
#include <bsp.h>


static rtems_task
testTask(rtems_task_argument argument)
{
    rtems_event_set events;

    while(1)
    {
        rtems_task_wake_after(1);
//      rtems_event_receive(RTEMS_EVENT_1, RTEMS_WAIT|RTEMS_EVENT_ANY, 1,
&events);

    }
}

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

    for (i = 0; i < 50; i++)
    {
        rtems_task_create(rtems_build_name('T','E','S','T'),
            100, RTEMS_MINIMUM_STACK_SIZE, RTEMS_DEFAULT_MODES,
            RTEMS_DEFAULT_ATTRIBUTES, &tid);
        rtems_task_start(tid, testTask, 0);
    }

    puts("\n");
    while(1)
    {
        printf("%08d  ", _Watchdog_Ticks_since_boot);
        fflush(stdout);
        rtems_task_wake_after(5);
    }

    rtems_task_suspend(RTEMS_SELF);
}


#define CONFIGURE_MAXIMUM_SEMAPHORES                    8
#define CONFIGURE_LIBIO_MAXIMUM_FILE_DESCRIPTORS        8
#define CONFIGURE_MAXIMUM_TASKS                         64

#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER

#define CONFIGURE_MICROSECONDS_PER_TICK                 1000

#define CONFIGURE_EXECUTIVE_RAM_SIZE                    (1024*1024)

#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
#define CONFIGURE_INIT


#include <confdefs.h>

////////////////// end of application //////////////////////////


I see only a some numbers which are printed from the Init task,
and then all output stops.

Changing rtems_task_wake_after directive to the rtems_event_receive with
the same timeout does not made the good situation too.

As I understood, both this directives (wake_after and event_receive) works
with the _Watchdog_Ticks_chain.

Clock interrupts handler works with this chain too
(_Watchdog_Tickle_ticks() directive).

In my opinion, there is no appropriate protection of this chain
then rtems_task_wake_after() and _Watchdog_Tickle_ticks() routines
are called 'together'.

When I added to the rtems_task_wake_after directive (taskwakeafter.c)
_ISR_Disable(level) at the beginning and the _ISR_Disable(level) at
the end, things goes much better!
Output from the my application is nevers stops.

Also then I modified the _Event_Seize directive by the same way
(I removed the _ISR_Enable - _ISR_Disable around the _Watchdog_Initialize),
my application begin to work good with the rtems_event_receive() directive.


What can you say about this?
Does such changes really needed to the RTEMS core or I mistake somewhere?

Best regards,
        Ilya Alexeev.

-------------------------------------------------------



More information about the users mailing list