#ifndef __CYCLIC_SCHEDULER_H__ #define __CYCLIC_SCHEDULER_H__ #include #include #define CYCLIC_MX_NUM_THREADS 10 // specific scheduling parameters for tasks typedef struct { struct timespec slice; int id; // for debugging purposes } cyclic_sched_params_t; // scheduler data (opaque type) typedef struct { struct timespec slices[CYCLIC_MX_NUM_THREADS]; pthread_t thread_ids[CYCLIC_MX_NUM_THREADS]; int num_threads; int current_slice; } cyclic_schr_data_t; /* * init */ void cyclic_init(void * sched_data); /* * new_thread */ void cyclic_new_thread(void * sched_data, pthread_t thread, posix_appsched_actions_t * actions); /* * cyclic_notification_for_thread */ void cyclic_notification_for_thread(void * sched_data, pthread_t thread, posix_appsched_actions_t * actions); /* * Show a message with the elapsed time * Auxiliary function. It is NOT a primitive operation of the * scheduler */ void report (char * message, int id); #endif // __CYCLIC_SCHEDULER_H__