⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 readme

📁 最新rtlinux内核源码
💻
字号:
/* * POSIX.4 Timers * * Written by J. Vidal * Copyright (C) Dec, 2002 OCERA Consortium. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation version 2. * * Programs to test POSIX.4 timers implementation. * */ * Name: accuracity.c * Description: Measures timer accuracity for both relative  * and absolute timer specifications. * * Procedure: 1.- Create a thread. *            2.- Program a periodic timer with some period (relative spec) or  *            a one-shot timer for absolute specification.  *            3.- Let expire the timer n times. If it is absolute, reprogram each time *            the timer by adding the period to the absolute time specification. *            4.- After n expirations, calculate the teoric time transcurred (n*period) *            and the real (end_time -start_time). *            5.- Print the error (difference between the teoric time transcurred  *            and the real one) * * Name: signals_bandwidth.c * Description: Measures POSIX.1 Signals bandwidth. *                                                   * Procedure: 1.- Create two threads, a parent and a child. *            2.- During an interval of time send signals between them. *            3.- Measure signals send/received per miliseconds. * * * Name: simple_test.c * Description: Simple program to test timers API.  * * Procedure: 1.- Create a user-defined number of tasks. *            2.- Make periodic them, with a period of 2 minutes. *            3.- Arm timers for each task. The firs tasks arms a *            one-shot timer and the others repeating timers with  *            an interval of 1 second. *            4.- Install a handler for each timer that wakes up each *            task every timer expiration. *            5.- Check that task period changes (for all tasks but the first) *            from 2 minutes to 1 second due to timers expirations and handlers executions. *  * Name: simple_test.c * Description: Simple program to test timers API.  * * Procedure: 1.- Create a user-defined number of tasks. *            2.- Make periodic them, with a period of 2 minutes. *            3.- Arm timers for each task. The firs tasks arms a *            one-shot timer and the others repeating timers with  *            a interval of 1 second. *            4.- Install a handler for each timer that wakes up each *            task every timer expiration. *            5.- Check that task period changes from 2 minutes to 1 second *            due to timers expirations and handlers executions. *  * Name: test.c  * Description: This program test RTLinux POSIX.4 timers real-time constraints. *              Provides support for testing both CLOCK_REALTIME & CLOCK_MONOTONIC. *              Also for system clock on mode ONESHOT or PERIODIC deppending on the  *              defines. * * Procedure: 1.- Create a user-defined number of tasks.  *            2.- Set the system clock on mode ONESHOT or PERIODIC. *            3.- Schedule them, using RTLinux API or timers & signals. *            4.- Analyse test chronograms.  * *            5.- NOTE: You will observe that the scheduler result using the RTLinux API *                and timers + signals, is basically the same. *                Also you will observe that test chronogram for timers based on  *                CLOCK_MONOTONIC and system clock on mode periodic is not synchronous. *                This is OK, since in RTLinux CLOCK_MONOTONIC with system clock on mode  *                periodic is different from CLOCK_REALTIME (the one used by the scheduler *                and test chronogram) * *		The monitor directory comes with a patched version of the scheduler that  *		informs about tasks activations and executions times. Also provides a  *              program (reader) to  get kernel information. You need to place the  *              program crono in that directory in order to see the chronograms (available  *              from http://bernia.disca.upv.es/rtportal). * * Name: timers.c * Description: Check that a timer can be programed by different threads * * Procedure: 1.- Create two tasks. *            2.- The first time both arm a timer. Only the last is the owner *            and therefore the one that will receive notification of timer expiraition. *            3.- The handler for that timer wakes up the other task, allowing it to *            program an action for the signal of the timer and set the timer. *            4.- The proces is repeated printing the time passed since last timer expiration. *            5.- Each time the timer is being programmed by a different thread.  *  * Name: timers.c * Description: Check that a timer can be programed by different threads * * Procedure: 1.- Create two tasks. *            2.- The first time boht arm a timer. Only the last is the owner *            and therefore the one that will receive notification of timer expiraition. *            3.- The handler for that timer wakes up the other task, allowing it to *            program an action for the signal of the timer and set the timer. *            4.- The proces is repeated printing the time passed since last timer expiration. *            5.- Each time the timer is being programmed by a different thread.  * 

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -