RTEMS Logo

RTEMS 4.7.1 On-Line Library


Rate Monotonic Period Statistics Updating Period Statistics

PREV UP NEXT Bookshelf New Chapters

2.4.2: Updating Period Statistics

It is the responsibility of each period task loop to update the statistics on each execution of its loop. The following is an example of a simple periodic task that uses the period statistics manager:

rtems_task Periodic_task()
{
  rtems_name        name;
  rtems_id          period;
  rtems_status_code status;

  name = rtems_build_name( 'P', 'E', 'R', 'D' );

  (void) rate_monotonic_create( name, &period );

  while ( 1 ) {
    if ( rate_monotonic_period( period, 100 ) == TIMEOUT )
      break;

    /* Perform some periodic actions */

    /* Report statistics */
    Period_usage_Update( period_id );
  }

  /* missed period so delete period and SELF */

  (void) rate_monotonic_delete( period );
  (void) task_delete( SELF );
}


PREV UP NEXT Bookshelf New Chapters

Copyright © 1988-2004 OAR Corporation