Listing 1. Example Real-Time Module Code Skeleton #include #include #include #include #include #include pthread_t thread_variable; void thread_name(void) { Struct Sched_param p; p.sched_priority = 1 pthread_setschedparam(pthread_self(), SCHED_FIFO, &p); pthread_make periodicnp(pthread_self(), getrtime(), 1000000); while(1) { // Real Time Task Code // Poll Data input lines, count low to high // transitions rtf_put() // Counts to be transferred by FIFO pthread_wait_np(); } } int handler_function(){ // Code tied to the handler FIFO // Variables for counting above are cleared out } int init_module(void) { ififo_status = rtl_create(unsigned int fifo, int size) pthread_create(&thread_variable, NULL, thread_name, NULL); rtf_create_handler(FIFO_Number, &handler_function) } int cleanup_module(void) { rtf_destroy(unsigned int fifo) pthread_cancel(thrad_variable) }