00001 /************************************************************************* 00002 This file is part of MESH. 00003 00004 MESH is free software: you can redistribute it and/or modify 00005 it under the terms of the GNU General Public License as published by 00006 the Free Software Foundation, either version 3 of the License, or 00007 (at your option) any later version. 00008 00009 MESH is distributed in the hope that it will be useful, 00010 but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00012 GNU General Public License for more details. 00013 00014 You should have received a copy of the GNU General Public License 00015 along with MESH. If not, see <http://www.gnu.org/licenses/>. 00016 **************************************************************************/ 00021 #ifndef MESH_DEF_SCHEDULERS_H 00022 #define MESH_DEF_SCHEDULERS_H 00023 00036 GSList * mesh_scheduler_rr(mesh_scheduler *cs); 00037 00049 GSList * mesh_scheduler_rr_w_overhead(mesh_scheduler *cs); 00050 00051 // These functions work together to model a time-slicing 00052 // scheduler. mesh_scheduler_timeslice() is the scheduling function 00053 // passed to mesh_create_scheduler(); mesh_init_timeslicing() should 00054 // be called *after* all resources have been added to the scheduler; 00055 // mesh_isr_timeslice_tick() should be registered as the handler for 00056 // an interrupt that fires with the desired frequency 00057 GSList *mesh_scheduler_timeslice(mesh_scheduler *cs); 00058 void mesh_init_timeslicing(mesh_scheduler *cs, int ticks_per_quantum); 00059 void *mesh_isr_timeslice_tick(void *arg); 00060 00061 00062 // This is the default shared resource scheduler 00063 void mesh_shared_scheduler_default(mesh_scheduler *cs, 00064 GSList *shared_info, 00065 mesh_time time_step); 00066 00077 mesh_thread *mesh_sched_get_eligible_thread_by_name(gchar *,mesh_scheduler *); 00078 00090 GSList *mesh_sched_find_idle_resources(mesh_scheduler *); 00091 00101 GSList * mesh_get_resource_by_name(gchar *name, 00102 GSList *list, 00103 mesh_resource **resource); 00104 00105 00106 #endif 00107
1.7.1