JP2607595B2 - Queuing table search method - Google Patents

Queuing table search method

Info

Publication number
JP2607595B2
JP2607595B2 JP63043821A JP4382188A JP2607595B2 JP 2607595 B2 JP2607595 B2 JP 2607595B2 JP 63043821 A JP63043821 A JP 63043821A JP 4382188 A JP4382188 A JP 4382188A JP 2607595 B2 JP2607595 B2 JP 2607595B2
Authority
JP
Japan
Prior art keywords
interrupt
search
queuing
processing
queued
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Fee Related
Application number
JP63043821A
Other languages
Japanese (ja)
Other versions
JPH01217638A (en
Inventor
吉晴 内山
寛 竹山
剛 清水
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hitachi Ltd
Original Assignee
Hitachi Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hitachi Ltd filed Critical Hitachi Ltd
Priority to JP63043821A priority Critical patent/JP2607595B2/en
Publication of JPH01217638A publication Critical patent/JPH01217638A/en
Application granted granted Critical
Publication of JP2607595B2 publication Critical patent/JP2607595B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Description

【発明の詳細な説明】 〔産業上の利用分野〕 本発明は、OS(オペレーティング・システム)の核と
なるニュークリアスの管理の下でキューイングされたテ
ーブル群から目的テーブルを検索しもしくは検索したテ
ーブルを参照するためのキューイングテーブル検索方法
に係り、例えば、イベントドリブン方式のリアルタイム
OSにおけるキューイングテーブル検索時に非同期で生ず
る外部割込みに対するリアルタイム性(即時応答性)の
向上に適用して有効な技術に関するものである。
DETAILED DESCRIPTION OF THE INVENTION [Industrial Application Field] The present invention relates to a table which retrieves a target table from a group of tables queued under the management of a nucleus which is a core of an OS (Operating System), or a table retrieved. Related to a queuing table search method for referring to, for example, an event-driven real-time
The present invention relates to a technique which is effective when applied to improvement of real-time property (immediate responsiveness) to an external interrupt generated asynchronously at the time of a queuing table search in an OS.

〔従来技術〕(Prior art)

マイクロコンピュータシステムの応用分野の広がりに
伴ってOSの役割と重要性が高まっている中で、計測制御
システムなど産業用に適用されるリアルタイムOSは、通
常リアルタイム制御を目的としてマルチタスキングをサ
ポートするため、外部装置や内部の処理要求に対して即
時処理を行い得る実時間での処理速度が要求される。特
に、リアルタイム性を重視する場合には、非同期で発生
する外部割込みに対する即時応答性が要求される。
With the role and importance of OSs increasing with the expansion of application fields of microcomputer systems, real-time OSs applied to industrial applications such as measurement control systems usually support multitasking for the purpose of real-time control. Therefore, a real-time processing speed that can immediately execute an external device or an internal processing request is required. In particular, when real-time performance is emphasized, immediate responsiveness to an asynchronous external interrupt is required.

ところで、OSのリアルタイム・マルチタスク処理を行
う核となるニュークリアスは、非同期に発生する外部装
置又は内部からのイベント(事象)を認識し、そのイベ
ントの処理結果に対応するタスクを実行するが、タスク
を優先度に応じてその実行スケジューリングを行うと共
に、タスクからのシステムコール(処理要求)を受け付
けてその処理を行う。例えば、ニュークリアスは、MPU
(マイクロ・プロセッシング・ユニット)をタスクに割
り付ける順序をタスクの優先度に従ってスケジューリン
グするスケジュラ、タスクの生成,起動,終了,削除な
どタスクの状態を管理するタスク管理、タスクの実行制
御のための時間監視を行うタイマ管理、タスクで必要な
メモリ領域の割り付け確保を行うメモリ管理、タスク間
の同期・通信処理を行う同期・通信管理などの機能モジ
ュールと、外部割込みの発生による割込み処理やタスク
への割込み発生の連絡を行う割込みハンドラ、及び例外
割込みに対する処理やシステムコールエラー処理を行う
例外ハンドラなどの非タスクによって構成される。
By the way, the nucleus, which is the core of the real-time multi-task processing of the OS, recognizes an asynchronous event that occurs from an external device or from inside, and executes a task corresponding to the processing result of the event. Is scheduled according to the priority, and a system call (processing request) from a task is received to perform the processing. For example, the nucleus is an MPU
A scheduler that schedules the order of assigning (micro-processing units) to tasks according to task priorities; task management to manage task states such as task creation, activation, termination, and deletion; and time monitoring for task execution control Function modules such as timer management, which performs task allocation, memory management, which secures the allocation of memory areas required for tasks, and synchronization / communication management, which performs synchronization / communication processing between tasks, as well as interrupt processing due to external interrupts and interruption to tasks It is composed of non-tasks such as an interrupt handler that reports occurrence and an exception handler that performs processing for exception interrupts and system call error processing.

これら機能モジュールはシステムコールを受け付けて
所定の処理を行うが、例えばタスク管理システムコール
によってタスクが生成される場合には、そのタスク固有
のID(アイデンティフィケーション)や優先度さらには
当該タスクのスタートアドレスなどがOSのワーキング領
域に割り付けられる。このようなワーキング領域への割
り付けは、同期・通信管理で生成されたイベントフラグ
やメイルボックス及びセマフォ、さらにはメモリ管理で
生成されたメモリプールのIDや大きさなどに対しても行
われる。このようにしてOSのワーキング領域に割り付け
られる種々の情報は、その内容に応じた管理ブロックに
キューイングされてテーブル群を構成する。
These function modules accept system calls and perform predetermined processing. For example, when a task is generated by a task management system call, a task-specific ID (identification), priority, and the like of the task are added. A start address and the like are assigned to a working area of the OS. Such allocation to the working area is also performed on the event flags, mailboxes and semaphores generated by the synchronization / communication management, and also on the IDs and sizes of the memory pools generated by the memory management. In this manner, various information allocated to the working area of the OS is queued in a management block corresponding to the content to form a table group.

このようにして構成される各種キューイングテーブル
群は、ニュークリアスの管理の下で、タスクから発行さ
れるシステムコール、さらには割込みハンドラや例外ハ
ンドラなど非タスクから発行されるシステムコールに基
づいて適宜に追加や削除が行われる。
Under the management of the nucleus, the various queuing tables configured as described above are appropriately assigned based on system calls issued from tasks and system calls issued from non-tasks such as interrupt handlers and exception handlers. Additions and deletions are made.

ところで、ニュークリアスの処理中にいろいろな外部
割込みが入るとその都度当処理は中断され、中断要因が
解除されると、また元の状態に復帰されるが、そのとき
の割込みによって割込みハンドラなどの非タスクから新
たなタスクを起動するシステムコールが発行されると、
当該システムコールによって起動されたタスクからOSの
ワーキング領域に対するキューイングテーブルの追加又
は削除を指示するシステムコールがなされる場合があ
る。さらには、割込みハンドラなどの非タスクから直接
キューイングテーブルの追加又は削除を指示するシステ
ムコールが発行される場合がある。このような場合に、
割込みによる中断要因が解除されて元の状態に戻ったと
き、既にOSのワーキング領域の内容は変更されている。
By the way, when various external interrupts are input during nucleus processing, this processing is interrupted each time, and when the cause of the interruption is released, the processing returns to the original state. When a system call that starts a new task from a task is issued,
A system call instructing addition or deletion of a queuing table to the working area of the OS may be made from a task started by the system call. Furthermore, there is a case where a non-task such as an interrupt handler issues a system call for directly adding or deleting a queuing table. In such a case,
When the cause of the interruption caused by the interrupt is released and the state returns to the original state, the contents of the working area of the OS have already been changed.

従来、割込みによるOSのワーキング領域の内容変更
が、中断要因解除後におけるニュークリアスの処理に望
ましくない影響を与える虞がある場合には、当該処理中
は外部割込みをマスクする方式が採られていた。
Conventionally, when a change in the contents of the working area of the OS due to an interrupt may undesirably affect the nucleus processing after the cancellation of the interruption factor, a method of masking an external interrupt during the processing has been adopted.

尚、リアルタイムOSについて記載された文献の例とし
ては昭和60年12月25日オーム社発行の「マイクロコンピ
ュータハンドブック」P546乃至P556がある。
An example of a document describing a real-time OS is "Microcomputer Handbook" P546 to P556 issued by Ohmsha on December 25, 1985.

〔発明が解決しようとする課題〕[Problems to be solved by the invention]

しかしながら、外部装置や内部の処理要求に対して、
即時処理を行い得る実時間での処理速度が要求されるリ
アルタイムOSにおいて、ニュークリアス処理中に外部割
込みをマスクする期間が長くなると、非同期で発生する
外部割込みに対する即時対応性の要求を満足することが
できなくなり、その性能低下をまぬがれない。本発明者
らの検討によれば、特に問題になるのは、OSのワーキン
グ領域内に形成されたキューイングテーブルを検索する
ような場合である。即ち、一連のキューイングテーブル
の数は最大限OSに登録可能なタスク数に呼応され、その
ようなテーブルを逐一選択してその内容を調べていく処
理時間は、目的テーブルの位置によっては極めて長くな
り、その間に優先度の高い全ての処理が待ち状態にされ
ることは、リアルタイム性を唱えるOSにとってその性能
低下をもたらすことになる。
However, for external devices and internal processing requests,
In a real-time OS that requires real-time processing speed that can perform immediate processing, if the period for masking external interrupts during nucleus processing becomes longer, the requirement for immediate response to asynchronous external interrupts may be satisfied. Can not be done and the performance degradation cannot be avoided. According to the study of the present inventors, a particular problem is a case where a queuing table formed in the working area of the OS is searched. In other words, the number of a series of queuing tables corresponds to the maximum number of tasks that can be registered in the OS, and the processing time for selecting such tables one by one and examining their contents is extremely long depending on the position of the target table. In the meantime, if all the high-priority processes are put in the waiting state, the performance of an OS that advocates real-time performance is reduced.

本発明の目的は、非同期で生ずる割込みに対する即時
応答性を向上させたキューイングテーブル検索方法を提
供することにある。
SUMMARY OF THE INVENTION It is an object of the present invention to provide a queuing table search method in which the immediate response to an interrupt generated asynchronously is improved.

本発明の前記並びにそのほかの目的と新規な特徴は、
本明細書の記述及び添付図面から明らかになるであろ
う。
The above and other objects and novel features of the present invention are as follows.
It will be apparent from the description of this specification and the accompanying drawings.

〔課題を解決するための手段〕[Means for solving the problem]

本願において開示される発明のうち代表的なものの概
要を簡単に説明すれば下記の通りである。
The outline of a representative invention among the inventions disclosed in the present application will be briefly described as follows.

すなわち、ニュークリアスの管理のもとで追加と削除
が許容されてキューイングされた複数のテーブルを順次
ポイントしながらその内容を調べて目的テーブルに到達
するための検索処理を行うキューイングテーブル検索方
法において、キューイングされた先頭テーブルに対して
検索処理を行う前に割り込み受け付けを禁止した状態で
テーブル変化フラグをリセット状態にする第1の処理
と、第1の処理の後に割り込みを受け付け可能とする割
り込み開放期間を形成する第2の処理と、前記割り込み
開放期間に割り込みが受付けられたとき当該割り込みが
前記キューイングされているテーブルの削除又は追加を
伴う場合に前記テーブル変化フラグをセット状態に変更
する第3の処理と、前記割り込み開放期間の終了後又は
当該割り込み開放期間に受け付けられた割り込み処理が
終了された後に前記テーブル変化フラグの状態を判定
し、判定結果がセット状態である場合には、前記第1の
処理を再度行わせてキューイングされている先頭テーブ
ルから検索処理をやり直しさせる第4の処理と、を設け
たことを特徴とするものである。
In other words, in a queuing table search method in which the contents are checked while sequentially pointing to a plurality of queued tables that are allowed to be added and deleted under the control of the nucleus, and a search process is performed to reach a target table. A first process for resetting the table change flag in a state where interrupt acceptance is prohibited before performing a search process on the queued top table, and an interrupt for enabling interrupt acceptance after the first process A second process for forming an open period, and changing the table change flag to a set state when an interrupt is received during the interrupt open period and the interrupt involves deletion or addition of the queued table. Third processing, after the end of the interrupt release period or the interrupt release period After the accepted interrupt processing is completed, the state of the table change flag is determined, and if the determination result is the set state, the first processing is performed again to search the queued top table. And a fourth process for restarting the process.

〔作 用〕(Operation)

上記した手段によれば、OSのワーキング領域でキュー
イングされた複数のテーブルを順次選択して目的テーブ
ルを検索するための一連のステップに含まれた割込み開
放期間に割込みが発生されると、当該割込みの種類例え
ば割込みベクタ番号に対応する割込みハンドラが起動さ
れる。スーパバイザモードで動作するこの割込みハンド
ラの処理中に発行されるシステムコールに直接的にもし
くは間接的に基づいて検索対象とされるテーブル群に対
するテーブルの追加又は削除が行われると、これに対応
するフラグがセットされる。割込み開放期間に割込みが
発生されても、これに起因して検索対象テーブル群に対
するテーブルの追加又は削除が行われない場合、及び割
込み開放期間に割込みが発生されない場合には、上記フ
ラグはリセット状態を保つ。このフラグの状態は、割込
み開放期間の終了後、もしくは当該割込み開放期間に割
込みが発生した後に割込みハンドラから元の制御状態に
復帰された後のステップで検査される。この検査の結
果、上記フラグがリセット状態に保たれているなら、検
索対象とされるテーブル群に対するテーブルの追加又は
削除は検索開始から現在にいたるまで行われていないた
め、次のテーブル検索ループの実行に移される。一方、
上記検査の結果、上記フラグがセット状態に反転されて
いるなら、検索対象とされるテーブル群の何れかに対し
てその追加又は削除が行われたことになり、そのような
テーブルの変化が検索済みテーブルに影響を与えている
可能性に対処するために、確率的に無効の可能性がある
過去の検索結果を無視してキューイングテーブルの検索
処理を先頭テーブルからやり直しする。
According to the above-described means, when an interrupt is generated during the interrupt release period included in a series of steps for sequentially selecting a plurality of tables queued in the working area of the OS and searching for the target table, An interrupt handler corresponding to the type of interrupt, for example, an interrupt vector number, is activated. When a table is added to or deleted from a group of tables to be searched based directly or indirectly on a system call issued during the processing of this interrupt handler operating in the supervisor mode, a flag corresponding to this is added. Is set. If an interrupt is generated during the interrupt release period, but no table is added or deleted from the search target table group due to this, and if no interrupt is generated during the interrupt release period, the above flag is reset. Keep. The state of this flag is checked after the end of the interrupt release period, or at a step after the interrupt handler returns to the original control state after an interrupt occurs during the interrupt release period. As a result of this inspection, if the flag is kept in the reset state, since addition or deletion of tables from the table group to be searched has not been performed from the start of the search to the present, the next table search loop Moved to execution. on the other hand,
As a result of the inspection, if the flag is inverted to the set state, it means that addition or deletion has been performed on any of the tables to be searched, and such a change in the table is searched. In order to cope with the possibility of affecting the completed table, the search processing of the queuing table is restarted from the top table, ignoring past search results that may be stochastically invalid.

これにより、外部割込みからのイベントの通知による
検索対象テーブルの変化に対処して、キューイングテー
ブルの検索途上で割込みを可能とし、もって、非同期で
生ずる割込みに対するOSの即時応答性を向上させるもの
である。
In this way, it is possible to cope with a change in the search target table due to notification of an event from an external interrupt and to enable an interrupt during the search of the queuing table, thereby improving the immediate response of the OS to an asynchronous interrupt. is there.

〔実 施 例〕〔Example〕

本実施例のキューイングテーブル検索方法は、イベン
トドリブン方式のリアルタイムOSを備えたマイクロコン
ピュータシステムに適用されるものである。このマイク
ロコンピュータシステムは、特に図示はしないが、マイ
クロ・プロセッシング・ユニット、RAM(ランダム・ア
クセス・メモリ)で構成されるような主記憶装置、ROM
(リード・オンリ・メモリ)で構成されるような補助記
憶装置、及び入出力コントローラなどが相互に情報をや
りとり可能にインタフェースされ、上記入出力コントロ
ーラ、さらには主記憶装置及び補助記憶装置が保有する
各種データやプログラムなどを使用して、所定のタスク
の処理を進めていくようになっている。リアルタイムOS
は、特に制限されないが、ROM化された補助記憶装置に
格納されている。
The queuing table search method according to the present embodiment is applied to a microcomputer system having an event-driven real-time OS. Although not shown, the microcomputer system includes a main unit such as a micro processing unit, a random access memory (RAM), and a ROM.
(A read-only memory), an auxiliary storage device, and an input / output controller are interfaced so that information can be exchanged with each other, and the input / output controller, the main storage device, and the auxiliary storage device hold the information. A predetermined task is processed using various data and programs. Real-time OS
Are stored in a ROMized auxiliary storage device, although not particularly limited.

このリアルタイムOSの核となるニュークリアスは、特
に制限されないが、図示しないマイクロ・プロセッシン
グ・ユニットをタスクに割り付ける順序をタスクの優先
度に従ってスケジューリングするスケジュラ、タスクの
生成,起動,終了,削除などタスクの状態を管理するタ
スク管理、タスクの実行制御のための時間監視を行うタ
イマ管理、タスクで必要なメモリ領域の割り付け確保を
行うメモリ管理、タスク間の同期・通信処理を行う同期
・通信管理などの機能モジュールと、外部割込みの発生
による割込み処理やタスクへの割込み発生の連絡を行う
割込みハンドラ、及び例外割込みに対する処理やシステ
ムコールエラー処理を行う例外ハンドラなどの非タスク
とによって構成される。
The nucleus that forms the core of the real-time OS is not particularly limited, but a scheduler that schedules the order in which microprocessing units (not shown) are assigned to the tasks in accordance with task priorities, and task states such as task creation, activation, termination, and deletion. Functions such as task management for managing tasks, timer management for monitoring time for task execution control, memory management for allocating memory areas required for tasks, and synchronization and communication management for synchronization and communication processing between tasks It is composed of modules and non-tasks such as an interrupt handler for notifying an interrupt process due to the occurrence of an external interrupt and the occurrence of an interrupt to a task, and an exception handler for performing a process for an exception interrupt and a system call error process.

リアルタイムOSの各種ワーキング領域や、タスクにと
って必要とされるユーザのメモリ領域は上記図示しない
主記憶装置に形成される。
Various working areas of the real-time OS and user memory areas required for tasks are formed in the main storage device (not shown).

リアルタイムOSのワーキング領域には、当該OSの機能
モジュールに対応して設定されたタスク管理ブロックや
メモリ管理ブロックのような各種管理ブロックが含ま
れ、各管理ブロックはリアルタイムOSの管理の下にキュ
ーイングされてテーブル群を構成する。尚、キューイン
グされたテーブル群又はそのテーブル群に含まれるテー
ブルを以下キューイングテーブルとも記す 例えば、タスク管理ブロックを構成する個々のテーブ
ルは、生成されたタスク固有のIDや優先度さらには当該
タスクのスタートアドレスなどを含んでキューイングさ
れている。また、メモリ管理ブロックを構成する個々の
テーブルは、割り付けられたメモリプールのIDやその大
きさなどの情報を含んでキューイングされている。さら
には、タスクの起動要求やメモリプールの生成要求に対
する待ち行列などもキューイングテーブルとしてワーキ
ング領域に形成されている。
The working area of the real-time OS includes various management blocks such as a task management block and a memory management block set corresponding to the function module of the OS, and each management block is queued under the control of the real-time OS. This constitutes a group of tables. Note that the queued table group or a table included in the table group is also referred to as a queuing table hereinafter.For example, each of the tables constituting the task management block includes an ID and a priority unique to the generated task, and furthermore, Queued including the start address of Further, each table constituting the memory management block is queued including information such as the ID of the allocated memory pool and its size. Further, queues for task activation requests and memory pool generation requests are also formed in the working area as queuing tables.

このようにして構成される各種キューイングテーブル
群は、ニュークリアスの管理の下で、タスクから発行さ
れるシステムコール、さらには割込みハンドラや例外ハ
ンドラなど非タスクから発行されるシステムコールに基
づいて適宜に追加や削除が行われる。
Under the management of the nucleus, the various queuing tables configured as described above are appropriately assigned based on system calls issued from tasks and system calls issued from non-tasks such as interrupt handlers and exception handlers. Additions and deletions are made.

第1図は本発明に係るキューイングテーブル検索方法
の一実施例を示すフローチャート、第2図はキューイン
グテーブルの追加や削除を行うテーブル変更モジュール
のフローチャートである。
FIG. 1 is a flowchart showing one embodiment of a queuing table search method according to the present invention, and FIG. 2 is a flowchart of a table change module for adding or deleting a queuing table.

先ず第2図に示されるテーブル変更モジュールは、キ
ューイングテーブルの追加及び削除、即ち、タスクの生
成及び削除、メモリプールの生成及び削除、イベントフ
ラグやメイルボックスさらにはセマフォの生成及び削除
などを行うためのシステムコールを処理するモジュール
とされる。このモジュールは1つのモジュールとして図
示されているが、実際にはリアルタイムOSを構成するタ
スク管理やメモリ管理などの各機能モジュールに含まれ
る。このテーブル変更モジュールは、キューイングテー
ブルの追加や削除を伴うシステムコールを処理すると
き、テーブル変化フラグを「1」にセットする。
First, the table change module shown in FIG. 2 adds and deletes a queuing table, that is, generates and deletes a task, generates and deletes a memory pool, and generates and deletes an event flag, a mailbox, and a semaphore. Module that processes system calls for Although this module is shown as one module, it is actually included in each function module such as task management and memory management that constitute the real-time OS. The table change module sets a table change flag to “1” when processing a system call involving addition or deletion of a queuing table.

キューイングテーブルの検索処理では先ず最初に外部
割込みを禁止し(ステップS1)、上記テーブル変化フラ
グを「0」にリセットしてから(ステップS2)、検索す
べき先頭のテーブルアドレスをポイントする(ステップ
S3)。
In the queuing table search process, first, the external interrupt is prohibited (step S1), the table change flag is reset to "0" (step S2), and the first table address to be searched is pointed (step S2).
S3).

ポイントされたテーブルを調べる前に一旦外部割込み
を開放し(ステップS4)、再び外部割込みを禁止(ステ
ップS5)した後に上記テーブル変化フラグを調べ(ステ
ップS6)、その結果がリセットである場合には先にポイ
ントされているテーブルの内容を、検索のための指定情
報と照合するなどして調べる(ステップS7)。調べた結
果当該テーブルが目的テーブルに一致しないと判別され
たときには(ステップS8)、キューイングされているテ
ーブルの最後まで検索したかの判別が行われ(ステップ
S9)、途中である場合にはその次に配列されているテー
ブルのアドレスをポイントして(ステップS10)、上記
ステップS4に戻る。このようにして順次テーブルのアド
レスポイントが更新されながら検索ループが形成され
る。
Before checking the pointed table, release the external interrupt once (step S4), disable the external interrupt again (step S5), and then check the table change flag (step S6). If the result is reset, The contents of the previously pointed table are checked by collation with the designated information for search (step S7). When it is determined that the table does not match the target table (step S8), it is determined whether the search has been performed to the end of the queued table (step S8).
S9) If it is in the middle, point to the address of the table arranged next (step S10), and return to step S4. Thus, a search loop is formed while the address points of the table are sequentially updated.

本実施例のキューイングテーブルの検索処理では1回
の検索ループ毎に外部割込み開放期間(ステップS4〜ス
テップS5)が形成されており、その間に外部割込みIRQ
が発生されると、当該検索処理は中断され、中断要因が
解除された後に元の処理に復帰される。
In the search processing of the queuing table of the present embodiment, an external interrupt release period (step S4 to step S5) is formed for each search loop, during which the external interrupt IRQ is set.
Is generated, the search process is interrupted, and the process returns to the original process after the cause of the interrupt is removed.

このとき、当該割込みIRQによって割込みハンドラな
どの非タスクから新たなタスクを起動するシステムコー
ルが発行されると、当該システムコールによって起動さ
れたタスクからOSのワーキング領域に対するキューイン
グテーブルの追加又は削除を指示するシステムコールが
なされる場合がある。さらには、割込みハンドラなどの
非タスクから直接キューイングテーブルの追加又は削除
を指示するシステムコールが発行される場合がある。こ
のとき、第2図に示されるテーブル変更モジュールによ
ってテーブル変化フラグが「1」にセットされる。
At this time, if the interrupt IRQ issues a system call that starts a new task from a non-task such as an interrupt handler, the task started by the system call adds or deletes the queuing table to the working area of the OS. An instructing system call may be made. Furthermore, there is a case where a non-task such as an interrupt handler issues a system call for directly adding or deleting a queuing table. At this time, the table change flag is set to "1" by the table change module shown in FIG.

割込み開放期間中に発生した外部割込みIRQに起因し
てキューイングテーブルの追加や削除があったときは、
その割込み開放期間に呼応する検索ループのステップS6
でテーブル変化フラグのセット状態が検出される。この
場合には、検索対象とされる一連のキューイングテーブ
ル群の何れかに対してその追加又は削除が行われたこと
になり、そのようなテーブルの変化が検索済みテーブル
に影響を与えている可能性に対処するため、確率的に無
効の可能性がある過去の検索結果を無視してキューイン
グテーブルの検索処理を先頭テーブルからやり直しする
ために、当該検索処理はステップS2に戻される。
When the queuing table is added or deleted due to the external interrupt IRQ generated during the interrupt release period,
Step S6 of the search loop corresponding to the interrupt release period
Detects the set state of the table change flag. In this case, addition or deletion is performed on any of a series of queuing tables to be searched, and such a change in the table affects the searched table. In order to deal with the possibility, the search processing is returned to step S2 in order to restart the search processing of the queuing table from the head table while ignoring the past search results that may be stochastically invalid.

このようにして、キューイングテーブルが順次選択さ
れてその内容が調べられていく途上で目的テーブルがあ
った場合には、ステップS8において検索ループから分岐
して当該キューイングテーブル検索処理が正常であった
旨の処理を行い(ステップS11)、外部割込みを開放し
て(ステップS12)、当該一連の検索処理を終了する。
また、最終テーブルにおいても目的テーブルに一致する
テーブルがなかった場合には、ステップS9において検索
ループから分岐して当該キューイングテーブル検索処理
が異常であった旨の処理が行われ(ステップS13)、外
部割込みを開放して(ステップS12)、当該一連の検索
処理を終了する。
In this way, if there is a target table while the queuing tables are sequentially selected and their contents are checked, the process branches off from the search loop in step S8 and the queuing table search processing is normal. Then, the external interrupt is released (step S12), and the series of search processing ends.
If there is no table that matches the target table in the final table, the process branches from the search loop in step S9, and processing is performed to the effect that the queuing table search process is abnormal (step S13). The external interrupt is released (step S12), and the series of search processing ends.

上記実施例によれば以下の作用効果を得るものであ
る。
According to the above embodiment, the following effects can be obtained.

(1)OSのワーキング領域内に形成されたキューイング
テーブルを検索するような場合に、一連のキューイング
テーブルの数は最大限OSに登録可能なタスク数に呼応さ
れ、そのようなテーブルを逐一選択してその内容を調べ
ていく処理時間は、目的テーブルの位置によっては極め
て長くなり得るが、本実施例のキューイングテーブルの
検索処理では1回の検索ループで外部割込み開放期間
(ステップS4〜ステップS5)が形成されているから、一
連の検索処理を終了するまで優先度の高い全ての処理が
待ち状態にされることはなく、非同期で生ずる外部割込
みに対する即時応答性を向上させてキューイングテーブ
ルの検索を行うことができる。
(1) In the case where a queuing table formed in the working area of the OS is searched, the number of a series of queuing tables corresponds to the maximum number of tasks that can be registered in the OS. The processing time for selecting and examining the contents can be extremely long depending on the position of the target table. However, in the search processing of the queuing table of the present embodiment, the external interrupt release period (steps S4 to S4) is performed in one search loop. Since step S5) is formed, all the high-priority processes are not put into a wait state until a series of search processes are completed, and queuing is performed by improving the immediate response to an external interrupt generated asynchronously. You can search the table.

例えば、100個のテーブルがキューイングされてい
て、目的テーブルが最後のテーブルとされるような場合
に、従来の検索ロジックでは1回の検索ループに要する
時間が20μsecとすると、目的テーブルを探し出すため
に100回の検索ループに呼応する2000μsecが経過する間
外部割込みが待ち状態にされる。これに対し、本実施例
の方式では1回の検索ループにステップS4,S5,S6の処理
が追加されて1回の検索ループに要する時間は僅かに増
えるが、1回の検索ループ毎に割込み開放期間が設けら
れているため、キューイングテーブル検索時における外
部割込みに対する即時応答性は著しく向上される。
For example, if 100 tables are queued and the target table is the last table, and the conventional search logic requires 20 μsec for one search loop, the target table is searched. An external interrupt is put into a wait state while 2000 μsec corresponding to 100 search loops elapses. On the other hand, in the method of the present embodiment, the processing of steps S4, S5, and S6 is added to one search loop, and the time required for one search loop slightly increases. Since the open period is provided, the immediate response to the external interrupt at the time of searching the queuing table is remarkably improved.

(2)1回の検索ループ毎に形成される外部割込み開放
期間(ステップS4〜ステップS5)に外部割込みが発生さ
れたとき、当該割込みによってキューイングテーブルの
追加や削除が行われると、テーブル変更モジュールのテ
ーブル変化フラグが「1」にセットされ、このテーブル
変化フラグの状態はステップS6で検索ループ毎に調べら
れ、そのセット状態が検出されると、そのようなテーブ
ルの変化が検索済みテーブルに影響を与えている可能性
に対処するため、確率的に無効の可能性がある過去の検
索結果を無視してキューイングテーブルの検索処理を先
頭テーブルからやり直しすることにより、検索ループ毎
に外部割込みを開放することによって発生する虞のある
検索対象テーブルの変化に的確に対処して、検索ループ
毎に外部割込みを開放することができる。
(2) When an external interrupt is generated during the external interrupt release period (step S4 to step S5) formed for each search loop, if the queuing table is added or deleted by the interrupt, the table is changed. The table change flag of the module is set to "1", the state of the table change flag is checked for each search loop in step S6, and when the set state is detected, such a change in the table is set in the searched table. In order to cope with the possibility of influence, ignore past search results that may be stochastically invalid and restart the queuing table search process from the top table, so that external interrupts are performed for each search loop Opening an external interrupt for each search loop, responding appropriately to changes in the search target table that may occur by opening It can be.

(3)上記各作用効果より、非同期で生ずる割込みに対
するリアルタイムOSの即時応答性を向上させることがで
きる。
(3) From the above-mentioned respective effects, the immediate response of the real-time OS to an interrupt generated asynchronously can be improved.

以上本発明者によってなされた発明を実施例に基づい
て具体的に説明したが本発明はそれに限定されずその要
旨を逸脱しない範囲において種々変更することができ
る。
The invention made by the present inventor has been specifically described based on the embodiments, but the present invention is not limited thereto, and can be variously modified without departing from the gist thereof.

例えば本発明のキューイングテーブル検索方式はリア
ルタイムOSに適用する場合に限定されるものではなく、
プログラム開発用OSさらにはリアルタイム処理を可能と
するプログラム開発用OSにも適用することができる。
For example, the queuing table search method of the present invention is not limited to application to a real-time OS,
The present invention can be applied to an OS for program development as well as an OS for program development that enables real-time processing.

以上の説明では主として本発明者によってなされた発
明をその背景となった利用分野である目的テーブルの検
索処理に適用した場合について説明したが、本発明はそ
れに限定されるものではなく、目的テーブルを順次探し
ながらその内容を参照する場合などにも適用することが
できる。本発明は、少なくともキューイングされたテー
ブルをサイクリックに選択しながら所定の処理を行う条
件のものに適用することができる。
In the above description, the case where the invention made by the present inventor is mainly applied to the search processing of the objective table which is the field of use as the background has been described. However, the present invention is not limited to this. The present invention can also be applied to a case where the contents are referred to while sequentially searching. INDUSTRIAL APPLICABILITY The present invention can be applied to a condition in which a predetermined process is performed while cyclically selecting at least a queued table.

〔発明の効果〕〔The invention's effect〕

本願において開示される発明のうち代表的なものによ
って得られる効果を簡単に説明すれば下記の通りであ
る。
The effects obtained by the representative inventions among the inventions disclosed in the present application will be briefly described as follows.

すなわち、キューイングテーブルから目的テーブルを
検索するための一連のステップに、外部割込みを受付可
能とする割込み開放期間を形成すると共に、その後にキ
ューイングテーブルの変化を示すフラグを検出するステ
ップを含み、その割込み開放期間に発生された割込みで
キューイングテーブルに変化があった場合には、そのよ
うなテーブルの変化が検索済みテーブルに影響を与えて
いる可能性に対処するために、確率的に無効の可能性が
ある過去の検索結果を無視してキューイングテーブルの
検索処理を先頭テーブルなどからやり直しすることによ
り、割込みからのイベントの通知による検索対象テーブ
ルの変化に対処して、キューイングテーブルの検索途上
で割込みを可能とし、これによって、非同期で生ずる割
込みに対する即時応答性を向上させたキューイングテー
ブル検索方式を得ることができ、もって、非同期で生ず
る割込みに対するOSの即時応答性を向上させることがで
きるという効果がある。
That is, a series of steps for searching for a target table from the queuing table includes forming an interrupt release period that allows external interrupts to be accepted, and thereafter detecting a flag indicating a change in the queuing table, If there is a change in the queuing table due to an interrupt that occurred during the interrupt release period, it is probabilistically invalid to address the possibility that such a change in the table may have affected the searched table. By restarting the queuing table search process from the top table etc. ignoring the past search results that may possibly occur, the queuing table Enables interrupts in the middle of a search, thereby providing an immediate response to interrupts that occur asynchronously. Sex can be obtained queuing table search method with improved, with it, there is an effect that it is possible to improve the immediate response of the OS to interrupts generated asynchronously.

【図面の簡単な説明】[Brief description of the drawings]

第1図は本発明に係るキューイングテーブル検索方法の
一実施例を示すフローチャート、 第2図はキューイングテーブルの追加や削除を行うテー
ブル変更モジュールのフローチャートである。 S4〜S5……割込み開放期間、S6……テーブル変化フラグ
の検出ステップ、IRQ……外部割込み。
FIG. 1 is a flowchart showing one embodiment of a queuing table search method according to the present invention, and FIG. 2 is a flowchart of a table change module for adding or deleting a queuing table. S4 to S5: Interrupt release period, S6: Table change flag detection step, IRQ: External interrupt.

───────────────────────────────────────────────────── フロントページの続き (72)発明者 清水 剛 東京都小平市上水本町1450番地 株式会 社日立製作所武蔵工場内 (56)参考文献 特開 昭59−189452(JP,A) 特公 昭58−28611(JP,B2) ────────────────────────────────────────────────── ─── Continuing from the front page (72) Inventor Tsuyoshi Shimizu 1450 Kamisumihoncho, Kodaira-shi, Tokyo Inside Musashi Plant of Hitachi, Ltd. (56) References JP-A-59-189452 (JP, A) Akira Tokubo 58-28611 (JP, B2)

Claims (1)

(57)【特許請求の範囲】(57) [Claims] 【請求項1】ニュークリアスの管理のもとで追加と削除
が許容されてキューイングされた複数のテーブルを順次
ポイントしながらその内容を調べて目的テーブルに到達
するための検索処理を行うキューイングテーブル検索方
法において、 キューイングされた先頭テーブルに対して検索処理を行
う前に割り込み受け付けを禁止した状態でテーブル変化
フラグをリセット状態にする第1の処理と、第1の処理
の後に割り込みを受け付け可能とする割り込み開放期間
を形成する第2の処理と、前記割り込み開放期間に割り
込みが受付けられたとき当該割り込みが前記キューイン
グされているテーブルの削除又は追加を伴う場合に前記
テーブル変化フラグをセット状態に変更する第3の処理
と、前記割り込み開放期間の終了後又は当該割り込み開
放期間に受け付けられた割り込み処理が終了された後に
前記テーブル変化フラグの状態を判定し、判定結果がセ
ット状態である場合には、前記第1の処理を再度行わせ
てキューイングされている先頭テーブルから検索処理を
やり直しさせる第4の処理と、を設けたことを特徴とす
るキューイングテーブル検索方法。
1. A queuing table for searching for contents while sequentially pointing to a plurality of queued tables permitted to be added and deleted under the control of a nucleus and performing a search process for reaching a target table. In the search method, a first process in which the table change flag is reset in a state where interrupt acceptance is disabled before performing a search process on the queued top table, and an interrupt can be accepted after the first process A second process for forming an interrupt release period, and setting the table change flag when an interrupt is received during the interrupt release period and the interrupt involves deletion or addition of the queued table. And a third process for changing the interrupt release period after the end of the interrupt release period or the interrupt release period The state of the table change flag is determined after the interrupt processing accepted in the middle is completed, and if the determination result is the set state, the first table is queued by performing the first processing again. A queuing table search method, comprising the steps of: starting a search process again;
JP63043821A 1988-02-26 1988-02-26 Queuing table search method Expired - Fee Related JP2607595B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP63043821A JP2607595B2 (en) 1988-02-26 1988-02-26 Queuing table search method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP63043821A JP2607595B2 (en) 1988-02-26 1988-02-26 Queuing table search method

Publications (2)

Publication Number Publication Date
JPH01217638A JPH01217638A (en) 1989-08-31
JP2607595B2 true JP2607595B2 (en) 1997-05-07

Family

ID=12674413

Family Applications (1)

Application Number Title Priority Date Filing Date
JP63043821A Expired - Fee Related JP2607595B2 (en) 1988-02-26 1988-02-26 Queuing table search method

Country Status (1)

Country Link
JP (1) JP2607595B2 (en)

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS5828611A (en) * 1981-08-13 1983-02-19 Alps Electric Co Ltd Magnetic type azimuth detector
JPS59189452A (en) * 1983-04-12 1984-10-27 Nec Corp Queue structure for data processor

Also Published As

Publication number Publication date
JPH01217638A (en) 1989-08-31

Similar Documents

Publication Publication Date Title
US6006247A (en) Method and system for scheduling threads and handling exceptions within a multiprocessor data processing system
US7472214B2 (en) Real-time embedded simple monitor method and computer product
KR970016979A (en) Queuing system and method of tasks in a multiprocessing system
US7296271B1 (en) Replaceable scheduling algorithm in multitasking kernel
GB2453284A (en) Mechanism for notifying a kernel of a thread entering a critical section.
US20230135951A1 (en) Scheduling of threads for clusters of processors
KR100617228B1 (en) method for implementation of transferring event in real-time operating system kernel
US6728962B1 (en) Context swapping in multitasking kernel
US20230138967A1 (en) Thread scheduling
JP3644042B2 (en) Multitask processing device
JP2001282558A (en) Multi-operating computer system
JP2607595B2 (en) Queuing table search method
JP2636722B2 (en) Multitask execution management method
EP1011045B1 (en) Object-oriented job scheduler
JP2643804B2 (en) Debug method
Arnold et al. Design of tightly-coupled multiprocessing programming
JPH05113887A (en) Computer system
JPH0895803A (en) Task scheduling method
US20230135214A1 (en) Interrupt handling
JP4003113B2 (en) Multithread control method in telephone exchange
JP2594557B2 (en) Multitask processing unit
JP2023091314A (en) Semiconductor device, control method of semiconductor device, and program
JPH05224961A (en) Time waiting processing system for task
JPH04195539A (en) System call processing system
JPH0640315B2 (en) Central processing unit allocation control method

Legal Events

Date Code Title Description
LAPS Cancellation because of no payment of annual fees