<Desc/Clms Page number 1>
Procédé pour commander un ordinateur traitant des interruptions, ordinateur et support d'enregistrement mettant en oeuvre le procédé
La présente invention se rapporte à un procédé de commande du fonctionnement d'un ordinateur pour traiter des interruptions. L'invention se rapporte aussi à un procédé de commande du fonctionnement d'un ordinateur pour valider les messages d'un
EMI1.1
bloc de messages à choisir dans une file d'attente de messages d'un certain nombre de blocs. En outre, t'invention se rapporte à un ordinateur et a un programme d'ordinateur pour commander l'ordinateur.
Suivant l'invention, il est prévu un procédé de commande du fonctionnement d'un ordinateur pour traiter un certain nombre d'interruptions d'une priorité croissante tandis qu'un processus de premier plan est suspendu, le procédé comprenant une validation d'une interruption ayant une priorité supérieure à celle de la tâche en cours d'exécution afin d'interrompre la tâche en cours d'exécution, un passage de l'interruption ayant la priorité supérieure, une augmentation de un d'un compteur d'interruption chaque fois qu'une interruption commence à passer, une diminution de un du compteur à l'achèvement de chaque interruption, un placement d'un drapeau de nouvelle planification'pour indiquer qu'une interruption a demandé une nouvelle planification des tâches à exécuter par I'ordinateur,
une recherche d'un drapeau de nouvelle planification lors de l'achèvement de toutes les interruptions, une nouvelle planification des täches dans l'ordinateur en réponse à la découverte d'un drapeau de nouvelle planification, un renvoi de l'ordinateur à un processus de premier plan qui a le degré de priorité le plus élevé et qui est pret a passer, toutes les interruptions ayant été achevées.
De préférence le procédé comprend l'appel d'un sous-programme pour augmenter le compteur d'interruption au commencement d'une interruption qui passe.
Dans une forme de réalisation de l'invention, le
<Desc/Clms Page number 2>
procédé recherche en outre un ou plusieurs messages d'un bloc de messages pour traiter, dans une file d'attente principale qui comprend un grand nombre de blocs de messages, les messages dudit bloc qui sont distribués au travers de la file d'attente principale, le procédé comprenant en outre un choix séquentiel des messages dans la file d'attente principale, l'établissement de ce que le message choisi appartient au bloc à traiter et de ce que le message est le dernier message dudit bloc, un transfert du message à la destination pour être traité si le message est un message dudit bloc, un transfert de chaque message, qui n'est pas dudit bloc et qui est trouvé avant de trouver le dernier message dudit bloc,
dans une file d'accumulation et une conservation de t'ordre des messages dans la file d'accumulation, semblable à leur ordre dans la file d'attente principale.
De préférence, les messages dans la file d'accumulation sont transférés au début de la file d'attente principale au moment où le dernier message dudit bloc a été transféré pour le traitement.
De plus l'invention prévoit un ordinateur comprenant des moyens destinés à recevoir un un grand nombre d'interruptions et des moyens pour assigner une priorité d'exécution à chaque interruption, l'ordinateur comprenant en outre des moyens pour interrompre une tâche en cours d'exécution afin d'autoriser une interruption ayant une priorité supérieure de passer, des moyens pour augmenter de un un compteur d'interruption chaque fois qu'une interruption commence à passer, des moyens pour diminuer de un le compteur d'interruption à l'achèvement de chaque interruption, des moyens pour placer un drapeau de nouvelle planification afin d'indiquer qu'une interruption a demandé la planification des tâches à exécuter par l'ordinateur, des moyens de recherche pour rechercher un drapeau de nouvelle planification à l'achèvement de toutes les interruptions,
des moyens de nouvelle planification pour planifier à nouveau les tâches dans l'ordinateur, les moyens de nouvelle planification étant sensibles à un drapeau de nouvelle planification trouvé, des moyens pour renvoyer l'ordinateur à un processus de premier plan qui présente la priorité la plus élevée et qui est prêt à passer.
Dans une autre forme de réalisation de l'invention,
<Desc/Clms Page number 3>
l'ordinateur comprend en outre un grand nombre de memoires intermé- diatres pour stocker un grand nombre de messages respectifs de blocs de messages, des messages étant stockés sous la forme d'une file d'attente principale, l'ordinateur comportant en outre des moyens pour rechercher un ou plusieurs messages d'un bloc à traiter, les moyens de recherche comprenant des moyens pour choisir séquentielle- ment les messages provenant des mémoires intermédiaires dans l'ordre de la file d'attente principale, des moyens pour établir si un message choisi est un message dudit bloc et si le message est le dernier message dudit bloc, des moyens pour transférer chaque message dudit bloc vers une destination pour être traiter, et des moyens pour transférer chaque message,
qui n'appartient pas audit bloc et qui est trouvé avant le dernier message dudit bloc, vers une file d'accumulation et des moyens pour conserver l'ordre des messages dans la file d'accumulation, de façon semblable à leur ordre dans la file d'attente principale.
Dans une autre forme de réalisation de l'invention, sont prévus des moyens pour transférer les messages provenant de la file d'accumulation vers la file d'attente principale, les moyens pour transférer les messages provenant de la file d'accumulation dans la file d'attente principale étant sensibles au dernier message en cours de transfert dudit bloc.
De plus, I'invention prévoit un programme d'ordinateur qui comprend le procédé de I'invention.
De plus, l'invention prévoit un support comprenant le programme d'ordinateur de l'invention.
L'invention sera plus clairement comprise à partir de la description suivante d'une forme de réalisation préférée, donnée au moyen d'un exemple, seulement avec référence aux dessins annexes.
La figure I est une vue schématique du fonctionnement d'un ordinateur sous la commande d'un programme d'ordinateur de l'invention.
La figure 2 est un ordinogramme d'un sous-programme du programme d'ordinateur suivant l'invention.
<Desc/Clms Page number 4>
La figure 3 est un ordinogramme d'un autre sous-pro- gramme du programme d'ordinateur suivant l'invention.
La figure 4 est un ordinogramme d'un autre sous-pro- gramme du programme d'ordinateur suivant l'invention.
Les figures 5 (a) à (d) sont des représentations schématiques du fonctionnement de l'ordinateur sous le commande- ment du programme d'ordinateur selon l'invention.
En se reportant aux dessins, il est illustré des sous-programmes de programme d'ordinateur pour commander Je fonctionnement d'un ordinateur afin de traiter des interruptions et pour choisir des messages a partir d'une file d'attente principale de messages. Les sous-programmes pour le traitement d'interruptions fonctionnent de façon que, pour une interruption reçue par l'ordinateur et un classement de priorité étant affecté par I'ordinateur, l'interrup- tion reçue peut interrompre la tâche ordinairement entreprise par l'ordinateur si l'interruption présente un classement de priorité supé- rieur à la täche qui est exécutée par l'ordinateur et qui peut être une autre interruption ou un processus de premier plan.
Ceci est particulièrement avantageux lorsque l'ordinateur est utilisé dans un environnement de communications en temps réel, qui demande une réponse rapide à des événements externes. Les sous-programmes de programme d'ordinateur destinés à choisir des messages a partir de la file d'attente principale de messages autorisent de choisir pour un traitement un ou plusieurs messages d'un bloc de messages à partir de la file d'attente de messages et ils permettent que les messages soient tranférés pour le traitement sans déranger l'ordre des messages. Les sous-programmes sont appelés par un programme principal d'ordinateur, qui commande le fonctionnement de l'ordinateur non illustré, de tels ordinateurs et de tels programmes d'ordinateur étant cependant connus par ceux qui sont versés dans le métier.
Seuls les sous-programmes du programme d'ordinateur qui forment l'invention, sont décrits en détail. Par mesure de clarté, les
EMI4.1
deux jeux de sous-programmes seront traités séparément. parernent.
En général, i1 est envisagé que les sous-programmes de programmes d'ordinateurs destinés à exécuter Ie procédé de l'inven-
<Desc/Clms Page number 5>
tion seront prévus dans un ordinateur. Cependant ils peuvent etre prévus sur un support approprié comme par exemple un support magné- tique, par exemple un disque souple, une bande magnétique, une disquette ou une pièce semblable.
Traitant d'abord le sous-programme d'interruption et se reportant aux figures l a 3, la figure 1 illustre à la manière d'un graphique le fonctionnement du sous-programme, dont les ordinogrammes sont illustrés dans les figures 2 et 3. Le programme d'ordinateur comporte un sous-programme pour affecter une priorité à chaque interruption reçue. Ce sous-programme n'est pas décrit, du reste de tels sous-programmes sont connus par l'homme de l'art. Pour une interruption à laquelle est affecté un classement de priorité, le classement de priorité de l'interruption est compare au classement de priorité du processus de premier plan qui passe ou de la tâche qui passe dans l'ordinateur.
Si l'interruption est d'un classement de priorité supérieur, le processus de premier plan ou la täche passant dans J10rdinateur est suspendu.
En se référant en particulier à la figure 1, la tâche exécutée, dans ce cas, dans le processus de premier p ! an PP presente un classement de priorité 0 et elle est passé pendant la période AB. Une interruption, en fait l'interruption Il ayant un classement de priorité 1, est reçue. L'interruption 11 est d'un classement de priorité supérieur à celui-ci de la tâche de processus de premier plan PP, ce qui fait suspendre la täche du processus de premier plan PP au moment B. L'interruption 11 d'un classement de priorité 1 commence à passer au moment B et continue jusqu'au moment C lorsqu'une deuxième interruption, en fait l'interruption 12, d'un classement de priorité 2, en d'autres mots d'un classement de priorité supérieur à celui de la première interruption, est reçu.
L'interruption Il, qui est la tâche passant dans l'ordinateur, est interrompue au moment C et l'interruption 2 commence à passer à partir du moment C et passe jusqu'à ce qu'elle soit achevée au moment D. A l'achèvement, t'ordinateur retourne à la täche précédente qui passait et qui, dans ce cas, est l'interruption 11 qui passe pour la durée de temps DE, phase à laquelle elle est achevée. L'ordinateur retourne
<Desc/Clms Page number 6>
au moment E, à une tâche dans le processus de premier plan qui est décrite ci-dessous.
Se référant à la figure 2, le sous-programme destiné à interrompre une täche passant dans l'ordinateur est illustré. Le bloc 1 procure l'interruption reçue. Le bloc 2 compare le classement de priorité de l'interruption au classement de priorité de la tâche passant dans l'ordinateur. Si le classement de priorité de l'interruption est inférieur à celui de la tâche passant dans l'ordinateur, le sous-programme retourne au bloc 1. Si le classement de priorité de l'interrup- tion est supérieur au classement de priorité de la tâche passant dans l'ordinateur, le sous-programme passe au bloc 3 qui provoque l'interruption et qui suspend la tâche passant ordinairement dans l'ordinateur. Le sous-programme se déplace alors au bloc 4 qui passe l'interruption.
Le bloc 5 augmente de un un compteur d'interruption, prenant de cette manière un enregistrement du nombre d'interruptions passantes et partiellement achevés. L'interruption continue à passer jusqu'à ce qu'elle soit achevée ou jusqu'à ce qu'elle soit interrompue par une interruption d'une priorité supérieure. Dans ce cas, si une interruption, en fait l'interruption 2, ayant une priorité supérieure à celle de l'interruption 1, est reçue, I'interruption 1 est interrompue comme déjà décrit.
Pour chaque interruption achevée, le sous-programme de la figure 3 est appelé. Le bloc 8 vérifie si l'interruption demande que la tâche exécutée dans le processus de premier plan de l'ordinateur soit à nouveau planifiée. Par exemple, si une interruption est la dernière d'une quantité de messages traitant une tâche particuliere et, à l'achèvement de l'interruption, si la tâche est prête à être passée dans le processus de premier plan, les tâches dans le processus de premier plan seraient à nouveau planifiées pour passer la tâche dont l'interruption fait partie dans l'ordre adéquat avec les taches du processus de premier plan. Si une nouvelle planification est demandée, le sous-programme se déplace au bloc 9 qui place un drapeau de nouvelle planification.
Le programme se déplace alors au bloc 10 qui procure la valeur du compte d'interruptions en cours. Si une nouvelle planification n'est pas demandée, le sous-pro-
<Desc/Clms Page number 7>
gramme se déplace directement au bloc 10. Le bloc l l vérifie si le compte d'interruptions est 1. En d'autres mots, si toutes les interruptions ont été achevées. Si le compte d'interruption n'est pas
EMI7.1
égal à 1, le sous-programme se déplace au bloc 12 qui diminue de l le compte d'interruptions, et le sous-programme se déplace alors au bloc 13 qui renvoie l'ordinateur afin d'exécuter 11 interruption précédemment interrompue.
EMI7.2
Si le bloc 11 détermine que le compte d'interrup- tions est 1, en d'autres mots, si la dernière interruption vient d'etre exécutée, le programme d'ordinateur se déplace au bloc 14 qui recherche un drapeau de nouvelle planification. Si aucun drapeau de nouvelle planification n'est trouvé, le programme d'ordinateur se déplace au bloc 17 qui renvoie l'ordinateur au processus de premier plan. D'autre part, si un drapeau de nouvelle planification est trouvé, le sous-programme se déplace au bloc 15 qui efface le drapeau de nouvelle planification et ensuite au bloc 16 qui exécute la nouvelle planification demandée. Après que la nouvelle planification soit achevée, le sous-programme se déplace au bloc 17. En consequence, l'ordinateur est renvoyé au processus de premier plan qui fonctionne conformément à la nouvelle planification.
Si la tâche dont fait partie n'importe quelle interruption demandant une nouvelle planification présente une priorité supérieure à celle de la täche suspendue dans le processus de premier plan, cette tâche ayant la priorité supérieure est passée avant la tâche suspendue du processus de premier plan.
D'autre part, si cette tâche présente un priorité inférieure à celle de la tâche suspendue du processus de premier plan, le processus de premier plan continue avec la tâche suspendue et la tâche dont fait partie l'interruption est traitée dans un ordre conformément à sa priorité.
En se reportant maintenant aux figures 4 et 5, le sous-programme de choix d'un message sera décrit maintenant. Un ordinogramme du sous-programme est illustré à la figure 4 tandis que le mouvement des messages à l'intérieur de ordinateur est illustre dans les figures 5 (a) à (d). Dans ce cas, des données et des informations sont stockées sous forme de blocs dans l'ordinateur. Chaque
<Desc/Clms Page number 8>
bloc comporte une quantité de messages indiqués par les numéros de référence 40 à 44. Les messages 40 à 44 sont stockés dans des mémoires intermédiaires dans l'ordinateur. Les messages 40 à 44
EMI8.1
pouvaient être typiquement reçus par l'ordinateur à partir d'un réseau de communication.
Les messages, tels qu'ils sont recus, sont stockés dans des mémoires intermédiaires et ils sont mis en file dans une file d'attente principale, voir la figure 5 (a). L'ordinateur en fonction- nant sous la commande du programme principal d'ordinateur, exécute chaque opération comme une tâche. Une täche possède un bloc de commande de tâche associé 45 qui est utilisé pour garder l'état de la tâche, voir la figure 5. Chaque bloc de commande de tâche
45 comporte aussi un bloc intercalé de commande de file 46. Le bloc de commande de file 46 garde, dans la file d'attente principale, des messages qui sont reçus d'autres taches. Un bloc de commande de file spécifique de tâches 47 garde pour chaque tâche des messages dans une file d'accumulation décrite ci-dessous.
Si la tâche passant dans l'ordinateur demande tous les messages d'un bloc, disons du bloc 1, le sous-programme de la figure 4 est appelé. Le bloc 20 procure le premier message dans la file d'attente principale, en fait le message 40. Le bloc 21 établit si le message 40 appartient au bloc à traiter. Si le premier message n'appartient pas au bloc I, le sous-programme se déplace au bloc 22 qui stocke le message dans une file d'accumulation formée par des mémoires intermédiaires de stockage momentané sous la commande du bloc de commande de file spécifique de tâches 47, voir la figure 5 (b). Les messages stockés dans la file d'accumulation sont stockés dans le même ordre qu'its présentaient dans la file d'attente principale. Le sous-programme retourne alors au bloc 20 pour obtenir le message suivant dans la file d'attente principale.
Si la comparaison du bloc 21 montre que le message 40 appartient au bloc I, le sous-programme se déplace au bloc 24. Le bloc 24 transfère le message vers une destination dans I'ordinateur, où la tâche est passée pour le traitement. Le sousprogramme se déplace alors au bloc 25. Le bloc 25 vérifie si le mes-
EMI8.2
sage reçu est le dernier message du bloc. Si ce n'est pas le dernier message, le sous-programme retourne au bloc 20 pour obtenir le
<Desc/Clms Page number 9>
message suivant qui suit dans la file. Si le message est le dernier message, le sous-programme se déplace au bloc 26 qui transfère en retour, les messages stockés dans la file d'accumulation, au début de la file d'attente principale dans l'ordre dans lequel ils étaient au début.
Le sous-programme se déplace alors au bloc 27 qui renvoie le sous-programme au bloc 20.
En se reportant maintenant particulièrement aux figures 5 (a) à (d) le fonctionnement du sous-programme de la figure 4 sera décrit. D'abord le sous-programme choisit le premier message, en fait le message 40 venant de la file d'attente principale. Puisque celui-ci est le premier message du bloc 1 qui est le bloc demandé,
EMI9.1
le premier message 40 du bloc 1 est transféré à la täche appropriée pour un traitement. Le sous-programme choisit alors dans la file d'attente principale le message suivant 41 qui, dans ce cas, est le premier message du bloc 2 transféré à la première position de la file d'accumulation, voir la figure 5 (b).
Le sous-programme choisit alors le message suivant 42 dans la file d'attente principale et qui est le deuxième message du bloc 2 ; ce message est déplacé d'une même manière dans la file d'accumulation et, dans ce cas, il est
EMI9.2
assigné à la deuxième position dans la file d'accumulation, voir la figure 5 (c). Le sous-programme choisit alors le message suivant 43 dans la file d'attente principale et qui dans ce cas est le dernier message (m) du bloc 1. Ce message est transféré vers une tâche appropriée. Le message 44 qui est le dernier message (n) du bloc 2 est enfin déplacé dans la file d'accumulation.
Puisque maintenant tous les messages du bloc 1 ont été choisis et transférés, le sous-programme sous la commande du bloc 26, transfère en retour tous les messages de la file d'accumulation, c'est-à-dire les premier et deuxième messages 41 et 42 du bloc 2, dans la file d'attente principale. On
EMI9.3
peut voir à partir des figures 5 (a) à (d) que dans tous les cas les messages 40 à 44 sont transférés à partir de la file d'attente principale vers la file d'accumulation de sorte que lorsqu'ils sont dans la file d'accumulation, ils se présentent dans le meme ordre qu'ils occupaient dans la file d'attente principale.
De même, lorsque les message 40 a 44 sont transférés à nouveau de la file d'accumulation
<Desc/Clms Page number 10>
dans la file d'attente principale, les messages restants de la file d'attente principale prennent le même ordre qu'ils occupaient avant que les messages soient transférés de la file d'attente principale dans la file d'accumulation. En d'autres mots, les messages, au moment d'être transférés de la file d'accumulation dans la file d'attente principale, prennent le même ordre dans la file d'attente principale que celui qu'ils occcupaient dans la file d'accumulation.
Le sous-programme de la figure 4 commence alors à choisir le premier message dans la file d'attente principale qui est maintenant le premier message 41 du bloc 2. En consequence, le sous-programme suivant l'invention permet de déplacer des messages de différents blocs de la file d'attente principale dans la file d'accumulation tandis qu'il conserve en même temps les messages dans leur ordre chronologique et qu'il leur permet d'être renvoyés dans la file d'attente principale dans. cet ordre chronologique après que les messages d'un bloc particulier aient été traités.
Bien que l'ordinateur ait été décrit comme fonctionnant sous la commande du programme d'ordinateur qui presente un sous-programme pour traiter des interruptions et pour traiter une mise en file, il sera apprécié que dans tous les cas it n'est pas nécessaire que les sous-programmes de traitement de file aient besoin d'être prévus.
<Desc / Clms Page number 1>
Method for controlling a computer handling interrupts, computer and recording medium implementing the method
The present invention relates to a method of controlling the operation of a computer for handling interrupts. The invention also relates to a method of controlling the operation of a computer to validate the messages of a
EMI1.1
message block to choose from a message queue of a certain number of blocks. Furthermore, the invention relates to a computer and to a computer program for controlling the computer.
According to the invention, there is provided a method of controlling the operation of a computer to process a number of interrupts of increasing priority while a foreground process is suspended, the method comprising a validation of a interrupt having a priority higher than that of the running task in order to interrupt the running task, a passage of the interrupt having the higher priority, an increase of one of an interrupt counter each once an interruption begins to pass, a decrease of one in the counter at the end of each interruption, placing of a new planning flag 'to indicate that an interruption has requested a new planning of the tasks to be executed by I 'computer,
searching for a redesign flag upon completion of all interrupts, redesigning tasks in the computer in response to finding a redesign flag, returning the computer to a process which has the highest priority and is ready to move on, all interruptions having been completed.
Preferably the method includes calling a subroutine to increase the interrupt counter at the start of a passing interrupt.
In one embodiment of the invention, the
<Desc / Clms Page number 2>
method further searches for one or more messages from a message block to process, in a main queue which includes a large number of message blocks, the messages of said block which are distributed across the main queue , the method further comprising a sequential choice of messages in the main queue, establishing that the chosen message belongs to the block to be processed and that the message is the last message of said block, a transfer of the message to the destination to be processed if the message is a message from said block, a transfer of each message, which is not from said block and which is found before finding the last message from said block,
in an accumulation queue and keeping the order of messages in the accumulation queue, similar to their order in the main queue.
Preferably, the messages in the accumulation queue are transferred to the start of the main queue at the time when the last message of said block has been transferred for processing.
In addition, the invention provides a computer comprising means intended to receive a large number of interruptions and means for assigning a priority of execution to each interruption, the computer further comprising means for interrupting a task in progress. execution in order to authorize an interrupt having a higher priority to pass, means for increasing by one an interrupt counter each time an interrupt begins to pass, means for decreasing by one the interrupt counter at the completion of each interruption, means for placing a redesign flag to indicate that an interruption has requested scheduling of the tasks to be performed by the computer, search means for searching for a redesign flag upon completion of all interruptions,
re-scheduling means for re-scheduling tasks in the computer, the re-scheduling means being responsive to a re-scheduling flag found, means for returning the computer to a foreground process which has the highest priority high and ready to move on.
In another embodiment of the invention,
<Desc / Clms Page number 3>
the computer further comprises a large number of intermediate memories for storing a large number of respective messages of message blocks, messages being stored in the form of a main queue, the computer further comprising means for searching for one or more messages from a block to be processed, the search means comprising means for sequentially choosing the messages coming from the intermediate memories in the order of the main queue, means for establishing whether a message selected is a message from said block and if the message is the last message from said block, means for transferring each message from said block to a destination for processing, and means for transferring each message,
which does not belong to said block and which is found before the last message of said block, towards an accumulation queue and means for preserving the order of the messages in the accumulation queue, in a manner similar to their order in the queue main waiting.
In another embodiment of the invention, means are provided for transferring the messages coming from the accumulation queue to the main queue, the means for transferring the messages coming from the accumulation queue in the queue main queue being sensitive to the last message being transferred from said block.
In addition, the invention provides a computer program which includes the method of the invention.
In addition, the invention provides a medium comprising the computer program of the invention.
The invention will be more clearly understood from the following description of a preferred embodiment, given by way of an example, only with reference to the accompanying drawings.
Figure I is a schematic view of the operation of a computer under the control of a computer program of the invention.
FIG. 2 is a flowchart of a subroutine of the computer program according to the invention.
<Desc / Clms Page number 4>
FIG. 3 is a flowchart of another subroutine of the computer program according to the invention.
Figure 4 is a flowchart of another subroutine of the computer program according to the invention.
FIGS. 5 (a) to (d) are schematic representations of the operation of the computer under the control of the computer program according to the invention.
Referring to the drawings, there are illustrated computer program routines for controlling the operation of a computer for handling interrupts and for selecting messages from a main message queue. The routines for interrupt processing operate so that, for an interrupt received by the computer and a priority ranking being assigned by the computer, the interrupt received may interrupt the task ordinarily undertaken by the computer if the interrupt has a priority ranking higher than the task which is executed by the computer and which can be another interrupt or a prominent process.
This is particularly advantageous when the computer is used in a real-time communications environment, which requires rapid response to external events. Computer program subroutines for selecting messages from the main message queue allow selection of one or more messages from a message block from the message queue for processing. messages and they allow the messages to be transferred for processing without disturbing the order of the messages. The subroutines are called by a main computer program, which controls the operation of the computer which is not illustrated, such computers and such computer programs being however known to those skilled in the art.
Only the subprograms of the computer program which form the invention are described in detail. For clarity, the
EMI4.1
two sets of subroutines will be treated separately. parernent.
In general, it is contemplated that the subprograms of computer programs intended to execute the method of the invention
<Desc / Clms Page number 5>
tion will be provided in a computer. However, they can be provided on a suitable support such as for example a magnetic support, for example a flexible disk, a magnetic tape, a floppy disk or the like.
First dealing with the interrupt subroutine and referring to FIGS. 3, FIG. 1 illustrates in a graphical manner the operation of the subroutine, the flow diagrams of which are illustrated in FIGS. 2 and 3. The computer program has a subroutine to assign priority to each interrupt received. This subroutine is not described, the rest of such subroutines are known to those skilled in the art. For an interrupt to which a priority classification is assigned, the priority classification of the interruption is compared to the priority classification of the foreground process which passes or of the task which passes on the computer.
If the interruption is of a higher priority classification, the foreground process or the task passing to the computer is suspended.
With particular reference to Figure 1, the task performed, in this case, in the process of first p! year PP has a priority 0 classification and it has passed during the AB period. An interruption, in fact the interruption It having a priority classification 1, is received. Interrupt 11 is of a higher priority ranking than this of the foreground process task PP, which causes the task of the foreground process PP to be suspended at time B. Interruption 11 of a ranking priority 1 begins to pass at time B and continues until time C when a second interruption, in fact interruption 12, of a priority 2 classification, in other words of a priority classification greater than that of the first interruption is received.
Interruption II, which is the task passing through the computer, is interrupted at time C and interrupt 2 begins to pass from time C and passes until it is completed at time D. At l Upon completion, the computer returns to the previous task which passed and which, in this case, is interrupt 11 which passes for the duration of time DE, the phase at which it is completed. The computer returns
<Desc / Clms Page number 6>
at time E, to a task in the foreground process which is described below.
Referring to Figure 2, the routine for interrupting a task passing through the computer is illustrated. Block 1 provides the received interrupt. Block 2 compares the priority classification of the interruption with the priority classification of the task passing through the computer. If the priority ranking of the interrupt is lower than that of the task passing through the computer, the subroutine returns to block 1. If the priority ranking of the interrupt is higher than the priority ranking of the task passing through the computer, the subroutine proceeds to block 3 which causes the interruption and which suspends the task ordinarily passing through the computer. The subroutine then moves to block 4 which passes the interrupt.
Block 5 increases by one interrupt counter, thereby taking a record of the number of passing and partially completed interrupts. The interrupt continues to pass until it is completed or until interrupted by an interrupt of higher priority. In this case, if an interrupt, in fact interrupt 2, having a priority higher than that of interrupt 1, is received, interrupt 1 is interrupted as already described.
For each interrupt completed, the subroutine of Figure 3 is called. Block 8 checks whether the interrupt requests that the task executed in the foreground process of the computer be scheduled again. For example, if an interrupt is the last of a quantity of messages dealing with a particular task and, at the end of the interruption, if the task is ready to be passed into the foreground process, the tasks in the process foreground would again be scheduled to pass the task of which the interruption is part in the correct order with the tasks of the foreground process. If a new schedule is requested, the subroutine moves to block 9 which places a new schedule flag.
The program then moves to block 10 which provides the value of the current interrupt count. If a new schedule is not requested, the subprogram
<Desc / Clms Page number 7>
gram moves directly to block 10. Block l l checks if the interrupt count is 1. In other words, if all the interruptions have been completed. If the interruption account is not
EMI7.1
equal to 1, the subroutine moves to block 12 which decreases the count of interruptions by l, and the subroutine then moves to block 13 which returns the computer in order to execute 11 interruption previously interrupted.
EMI7.2
If block 11 determines that the interrupt count is 1, in other words, if the last interrupt has just been executed, the computer program moves to block 14 which searches for a redesign flag. If no redesign flag is found, the computer program moves to block 17 which returns the computer to the foreground process. On the other hand, if a new planning flag is found, the subroutine moves to block 15 which clears the new planning flag and then to block 16 which executes the requested new planning. After the new schedule is completed, the routine moves to block 17. As a result, the computer is returned to the foreground process which operates according to the new schedule.
If the task of which any interrupt requesting a new schedule is part has a higher priority than the task suspended in the foreground process, this task having the highest priority is placed before the task suspended in the foreground process.
On the other hand, if this task has a lower priority than the suspended task of the foreground process, the foreground process continues with the suspended task and the task of which the interruption is part is treated in an order in accordance with his priority.
Referring now to Figures 4 and 5, the message selection routine will now be described. A flow diagram of the subroutine is illustrated in Figure 4 while the movement of messages inside the computer is illustrated in Figures 5 (a) to (d). In this case, data and information are stored in blocks in the computer. Each
<Desc / Clms Page number 8>
block contains a quantity of messages indicated by reference numbers 40 to 44. Messages 40 to 44 are stored in intermediate memories in the computer. Messages 40 to 44
EMI8.1
could typically be received by the computer from a communications network.
Messages, as received, are stored in intermediate memories and are queued in a main queue, see Figure 5 (a). The computer, operating under the control of the main computer program, performs each operation as a task. A task has an associated task control block 45 which is used to keep the state of the task, see Figure 5. Each task control block
45 also includes an interposed queue control block 46. The queue control block 46 keeps messages in the main queue which are received from other tasks. A specific task queue control block 47 keeps messages for each task in an accumulation queue described below.
If the task passing through the computer requests all the messages in a block, say from block 1, the subroutine in FIG. 4 is called. Block 20 provides the first message in the main queue, in fact message 40. Block 21 establishes whether message 40 belongs to the block to be processed. If the first message does not belong to block I, the subroutine moves to block 22 which stores the message in an accumulation queue formed by intermediate memories of temporary storage under the control of the specific queue command block of tasks 47, see figure 5 (b). Messages stored in the accumulation queue are stored in the same order as they were in the main queue. The subroutine then returns to block 20 to obtain the next message in the main queue.
If the comparison of block 21 shows that the message 40 belongs to block I, the subroutine moves to block 24. Block 24 transfers the message to a destination in the computer, where the task is passed for processing. The subprogram then moves to block 25. Block 25 checks whether the mes-
EMI8.2
sage received is the last message in the block. If it is not the last message, the subroutine returns to block 20 to obtain the
<Desc / Clms Page number 9>
next message that follows in the queue. If the message is the last message, the subroutine moves to block 26 which transfers back, the messages stored in the accumulation queue, to the start of the main queue in the order in which they were at start.
The subroutine then moves to block 27 which returns the subroutine to block 20.
Referring now particularly to Figures 5 (a) to (d) the operation of the subroutine of Figure 4 will be described. First the subroutine chooses the first message, in fact message 40 from the main queue. Since this is the first message in block 1 which is the requested block,
EMI9.1
the first message 40 of block 1 is transferred to the appropriate task for processing. The subroutine then chooses in the main queue the following message 41 which, in this case, is the first message of block 2 transferred to the first position of the accumulation queue, see FIG. 5 (b).
The subroutine then chooses the following message 42 in the main queue and which is the second message of block 2; this message is moved in the same way in the accumulation queue and, in this case, it is
EMI9.2
assigned to the second position in the accumulation queue, see Figure 5 (c). The subroutine then chooses the following message 43 in the main queue and which in this case is the last message (m) in block 1. This message is transferred to an appropriate task. Message 44 which is the last message (n) of block 2 is finally moved to the accumulation queue.
Since now all the messages of block 1 have been chosen and transferred, the subroutine under the control of block 26, transfers in return all the messages of the accumulation queue, i.e. the first and second messages 41 and 42 of block 2, in the main queue. We
EMI9.3
can see from Figures 5 (a) to (d) that in all cases messages 40 to 44 are transferred from the main queue to the accumulation queue so that when they are in the accumulation queue, they appear in the same order as they occupied in the main queue.
Similarly, when messages 40 to 44 are transferred again from the accumulation queue
<Desc / Clms Page number 10>
In the main queue, the remaining messages in the main queue take the same order they occupied before the messages are transferred from the main queue to the accumulation queue. In other words, the messages, when transferred from the accumulation queue to the main queue, take the same order in the main queue as they occupied in the queue. 'accumulation.
The subroutine of FIG. 4 then begins to choose the first message in the main queue which is now the first message 41 of block 2. Consequently, the subroutine according to the invention makes it possible to move messages from different blocks from the main queue in the accumulation queue while at the same time keeping messages in chronological order and allowing them to be returned to the main queue in. this chronological order after the messages of a particular block have been processed.
Although the computer has been described as operating under the control of the computer program which presents a subroutine to handle interrupts and to process queuing, it will be appreciated that in any case it is not necessary that queue processing routines need to be scheduled.