Difference between revisions of "Lib/sequencer offers Multitasking"

From Liberty Eiffel Wiki
Jump to navigation Jump to search
(began translation)
(still translating)
Line 6: Line 6:
 
The principle is:
 
The principle is:
   
* the class [[library_class:LOOP_STACK|<tt>LOOP_STACK</tt>]] manages th emulti-tasking;
+
* the class [[library_class:LOOP_STACK|<tt>LOOP_STACK</tt>]] manages the multi-tasking;
 
* the class [[library_class:JOB|<tt>JOB</TT>]] represents a task. The task core is the <tt>continue</tt> feature, in which the task controls the whole system;
 
* the class [[library_class:JOB|<tt>JOB</TT>]] represents a task. The task core is the <tt>continue</tt> feature, in which the task controls the whole system;
 
* the class [[library_class:READY_DESCRIPTION|<tt>READY_DESCRIPTION</tt>]] allows to describe in which conditions a task can be executed.
 
* the class [[library_class:READY_DESCRIPTION|<tt>READY_DESCRIPTION</tt>]] allows to describe in which conditions a task can be executed.
Line 12: Line 12:
 
We will successively see each of those concepts.
 
We will successively see each of those concepts.
   
  +
== The multi-tasking manager ==
<!--
 
  +
The class [[library_class:LOOP_STACK|<tt>LOOP_STACK</tt>]] is in charge of managing the multi-tasking. It is used in two steps:
== Gestionnaire du multi-tâches ==
 
  +
* initialisation: creation of the <tt>LOOP_STACK</tt> object, and adding of the tasks to execute
C'est la classe [[library_class:LOOP_STACK|<tt>LOOP_STACK</tt>]] qui est chargée de gérer les multiples tâches. On l'utilise en deux étapes&nbsp;:
 
  +
* execution: execution of the <tt>run</tt> feature
* initialisation&nbsp;: création de l'objet <tt>LOOP_STACK</tt> et ajout des tâches à exécuter
 
* exécution&nbsp;: exécution de la méthode <tt>run</tt>
 
   
Bien sûr, on peut ajouter des tâches en cours d'exécution. Le gestionnaire peut aussi être arrêté, grâce à la méthode <tt>break</tt>.
+
Of course, tasks can be added during the execution. The manager can also be stopped, thanks to the <tt>break</tt> feature.
   
D'autre part, la pile de boucles est composée de plusieurs boucles d'exécution ([[library_class:LOOP_ITEM|<tt>LOOP_ITEM</tt>]]). Ceci permet, par exemple, d'implanter une forme de ''modalité'' (cf. les fenêtres modales de [[lib/vision|Vision]])
+
Also, the loops stack is composed of many execution loops ([[library_class:LOOP_ITEM|<tt>LOOP_ITEM</tt>]]). This allows, for instance, the implementation of a kind of ''modality'' (see the modal windows in [[lib/vision|Vision]]).
   
  +
<!--
 
== Les tâches ==
 
== Les tâches ==
   

Revision as of 14:39, 4 January 2006

*** OK, I'm translating that --Cyril 14:34, 4 Jan 2006 (CET)

The lib/sequencer library implements one kind of cooperative multi-tasking of the event-driver kind. Unlike "pure" cooperative multi-tasking, a task cannot stop at any time (using an hypothetic yield feature) but only in lnown and stable states. That is conform to the Eiffel principles.

The principle is:

  • the class LOOP_STACK manages the multi-tasking;
  • the class JOB represents a task. The task core is the continue feature, in which the task controls the whole system;
  • the class READY_DESCRIPTION allows to describe in which conditions a task can be executed.

We will successively see each of those concepts.

The multi-tasking manager

The class LOOP_STACK is in charge of managing the multi-tasking. It is used in two steps:

  • initialisation: creation of the LOOP_STACK object, and adding of the tasks to execute
  • execution: execution of the run feature

Of course, tasks can be added during the execution. The manager can also be stopped, thanks to the break feature.

Also, the loops stack is composed of many execution loops (LOOP_ITEM). This allows, for instance, the implementation of a kind of modality (see the modal windows in Vision).