From f1bb1a01ca40b8c999346c701450fcf0ca74827a Mon Sep 17 00:00:00 2001 From: gdisirio Date: Fri, 12 Mar 2010 11:25:52 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@1738 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- docs/src/roundrobin.dox | 50 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 docs/src/roundrobin.dox (limited to 'docs/src/roundrobin.dox') diff --git a/docs/src/roundrobin.dox b/docs/src/roundrobin.dox new file mode 100644 index 000000000..8158a5c03 --- /dev/null +++ b/docs/src/roundrobin.dox @@ -0,0 +1,50 @@ +/* + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + + This file is part of ChibiOS/RT. + + ChibiOS/RT 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; either version 3 of the License, or + (at your option) any later version. + + ChibiOS/RT is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +/** + * @page article_roundrobin Round Robin scheduling explained + * Unlike many other RTOSes, ChibiOS/RT supports multiple threads at the + * same priority level and schedules them using an aggressive + * round-robin strategy.
+ * The strategy is defined as aggressive because any scheduling event + * can cause the round-robin threads to rotate.
+ * A round-robin rotation can happen because of the following events: + * - The currently executed thread voluntarily invokes the @p chThdYield() + * API in order to allow the execution of another thread at the same + * priority level, if any. + * - The currently executed thread voluntarily goes into a sleep state + * (see @ref thread_states), when the thread is waken it goes behind + * all the other threads at the same priority level. + * - The currently executed thread is preempted by an higher priority + * thread, the thread is reinserted in the ready list (see @ref scheduling) + * behind all the other threads at the same priority level. + * - If the @p CH_TIME_QUANTUM configuration constant is set to a value + * greater than zero and if the specified time quantum expired and if + * a thread with equal priority is ready then the currently executing + * thread is automatically reinserted in the ready list behind all the + * other threads at the same priority level. + * . + * As you can see the @p CH_TIME_QUANTUM setting is really useful only if + * there are threads at the same priority level that can run not preempted + * for long periods of time and that do not explicitly yield using + * @p chThdYield(). Because of this you should consider to set + * @p CH_TIME_QUANTUM to zero in your configuration file, this makes the + * kernel much faster and smaller and does not forbid the use of + * multiple threads at the same priority level. + */ -- cgit v1.2.3