JPH01195542A - Multi-programming processor - Google Patents

Multi-programming processor

Info

Publication number
JPH01195542A
JPH01195542A JP1974788A JP1974788A JPH01195542A JP H01195542 A JPH01195542 A JP H01195542A JP 1974788 A JP1974788 A JP 1974788A JP 1974788 A JP1974788 A JP 1974788A JP H01195542 A JPH01195542 A JP H01195542A
Authority
JP
Japan
Prior art keywords
task
instruction
processing
data
queue
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.)
Pending
Application number
JP1974788A
Other languages
Japanese (ja)
Inventor
Hajime Sakuma
肇 佐久間
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.)
NEC Corp
Original Assignee
NEC Corp
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 NEC Corp filed Critical NEC Corp
Priority to JP1974788A priority Critical patent/JPH01195542A/en
Publication of JPH01195542A publication Critical patent/JPH01195542A/en
Pending legal-status Critical Current

Links

Abstract

PURPOSE:To decrease the interruption inhibiting areas and to improve the interruption response by permitting or inhibiting the operation of data based on the storage state. CONSTITUTION:When a processor containing three exclusive instructions carries out a deleting instruction, the processor decides a control flag included in an OS data control part 11 corresponding to a relevant queue. The normal processing of an instruction V is carried out only in case no access conflict occurs with a semaphore at occurrence of an instruction. In a successive process of an instruction P, a dispatch instruction is carried out after a task is deleted out of a ready queue to complete said successive process. In such a way of processing, an operating system can be described without inhibiting the interruption during execution of a system call instruction P and the instruction V.

Description

【発明の詳細な説明】 産業上の利用分野 本発明は、コンピュータの内部または外部で非同期に発
生する事象に対応して、複数のタスクを並列1こ実行す
るマルチプログラミング処理を実現する情報処理装置に
関する。
DETAILED DESCRIPTION OF THE INVENTION Field of Industrial Application The present invention relates to an information processing device that realizes multiprogramming processing that executes multiple tasks in parallel in response to events that occur asynchronously inside or outside a computer. Regarding.

従来の技術 従来、マルチプログラミングシステムでは、プログラム
を複数のタスクに分割し、個々のタスクを時分割に実行
することで、見掛は上、恰も各タスクを並行に実行して
いるような処理方法が採られている。
Conventional technology Conventionally, in multiprogramming systems, a program is divided into multiple tasks and each task is executed in a time-sharing manner, giving the appearance that each task is being executed in parallel. is taken.

各タスクの実行状態や同期関係を管理するのは、オペレ
ーティングシステムであり、オペレーティングシステム
は、通常命令の組み合わせで実現されている。オペレー
ティングシステムは、それぞれのタスクを管理するため
に、各タスク毎に割り当てられたデータ構造を操作し、
タスクのステータスや、タスクの実行環境などを管理す
る。
The operating system manages the execution status and synchronization relationship of each task, and the operating system is usually realized by a combination of instructions. In order to manage each task, the operating system operates on data structures allocated to each task.
Manage task status, task execution environment, etc.

また、オペレーティングシステムは、数々の機能を備え
、プロゲラ′ムからオペレーティングシステムに対して
システムコールを発行することで、これらの機能を利用
することができる。
Furthermore, the operating system has a number of functions, and these functions can be utilized by issuing system calls from the program program to the operating system.

しかしながら、マルチプログラミングシステムでは、複
数のタスクが、同じシステムコールを同時に発行すると
、互いに干渉し、障害となるのでオペレーティングシス
テムは、複数のタスクが、同じシステムコールを同時に
発行することがないように管理している。
However, in a multiprogramming system, if multiple tasks issue the same system call at the same time, they will interfere with each other and cause a problem, so the operating system manages to prevent multiple tasks from issuing the same system call at the same time. are doing.

第6図に、マルチプログラミングシステムにおけるシス
テムコール利用の際の、相互排除の例を示す。
FIG. 6 shows an example of mutual exclusion when using system calls in a multiprogramming system.

本例では、タスク1とタスク202つのタスクが、共通
のIloを利用する際の相互排除の例を説明する。
In this example, an example of mutual exclusion when two tasks, task 1 and task 20, use a common Ilo will be described.

通常、相互排除にはセマフォと呼ばれるフラグを利用し
、このセマフォを操作するためのシステムコールにP命
令とV命令がある。
Normally, a flag called a semaphore is used for mutual exclusion, and system calls for operating this semaphore include P and V instructions.

まず、タスクlおよびタスク2のうちで、より早く実行
状態に遷移した方がシステムコールPを発行する。今、
タスク1が先に実行権を得た場合を想定する。システム
コールPの処理では、セマフォがセット状態か、リセッ
ト状態かを示すピット(以下セマフォピットと呼ぶ)を
判定し、セット状態であればリセット状態にし、制御は
ただちにシステムコールPの発行時点に戻り、処理を継
続する。
First, between task 1 and task 2, the one that transitions to the execution state sooner issues system call P. now,
Assume that task 1 obtains execution rights first. In the processing of system call P, the pit (hereinafter referred to as semaphore pit) indicating whether the semaphore is set or reset is determined, and if the semaphore is set, it is reset, and control immediately returns to the point in time when system call P was issued. , continue processing.

タスク1が共通I10の処理中に、割り込みなどでタス
ク2に制御が移り、タスク2も同じ共通I10に対して
処理を行おうと、セマフォにP命令を発行したとすると
、セマフォピットは既にリセット状態であるため、タス
ク2は待ち状態に遷移する。
When task 1 is processing common I10, control is transferred to task 2 due to an interrupt, etc., and task 2 also issues a P command to the semaphore in order to process the same common I10.The semaphore pit is already in the reset state. Therefore, task 2 transitions to the wait state.

タスク1の処理が終了し、セマフォに対するV命令を発
行すると、そのセマフォに対して待ち状態となっている
タスク2は、待ち状態から解放され実行状態へ遷移する
ことが可能となる。つまり先行したタスク1によるV命
令発行によって、タスク2は、初めて上記の共通I10
処理に遷移することが可能となる。
When task 1 completes its processing and issues a V command for the semaphore, task 2, which is in the wait state for that semaphore, is released from the wait state and can transition to the execution state. In other words, by issuing the V instruction by the preceding task 1, task 2 issues the above common I10 command for the first time.
It becomes possible to transition to processing.

以上説明したような機構で、複数のタスクが共通の処理
を行う場合の衝突を防いでいる。
The mechanism described above prevents conflicts when multiple tasks perform common processing.

第7図は、P命令、■命令に対応するオペレーティング
システムの処理を示したもので、その概略フローを記述
しである。
FIG. 7 shows the processing of the operating system corresponding to the P command and the ■ command, and describes the general flow.

P命令の処理では、P命令のオペランドで指定されたセ
マフォの識別子から、対応するセマフォ用のデータエリ
アを算出し、そのデータエリア中に管理されているセマ
フォビットを判定する。
In the processing of the P instruction, the data area for the corresponding semaphore is calculated from the semaphore identifier specified by the operand of the P instruction, and the semaphore bits managed in the data area are determined.

セマフォビットがすでにクリア(リセット)状態であれ
ば、口1で割り込み禁止状態にし、セマフォ用待ちタス
クキューに、P命令発行タスクを登録し、該発行タスク
のステータスを待ち状態に操作する。さらに、実行可能
タスクの管理ブロック(以下レデイキニ−と呼ぶ)から
発行タスクを削除し、次に実行状態にするタスクを選択
する。
If the semaphore bit is already in the cleared (reset) state, interrupts are disabled in step 1, the P command issuing task is registered in the semaphore waiting task queue, and the status of the issuing task is changed to the waiting state. Furthermore, the issued task is deleted from the executable task management block (hereinafter referred to as ready-to-do task), and the next task to be put into the execution state is selected.

(以下これをディスパッチ処理と呼ぶ)その後、8Iで
割り込み許可にする。
(Hereinafter, this will be referred to as dispatch processing.) After that, interrupts are enabled at 8I.

セマフォビットが既にセット状態であれば、セマフォビ
ットをクリアするだけで即ディスパッチ処理を行う゛。
If the semaphore bit is already set, just clearing the semaphore bit will immediately perform dispatch processing.

■命令の処理では、P命令と同様に、V命令のオペラン
ドで指定されたセマフォの識別子から、対応するセマフ
ォ用のデータエリアを算出し、そのデータエリア中に管
理されている待ちタスクキューを判定する。
■In instruction processing, like the P instruction, the data area for the corresponding semaphore is calculated from the semaphore identifier specified by the operand of the V instruction, and the waiting task queue managed in that data area is determined. do.

待ちタスクキューにタスクが在れば、DIで割り込み禁
止状態にし、待ちタスクキューから待ちタスクを削除し
、そのタスクのステータスを待ち状態から実行可能状態
に操作し、レディキューにそのタスクを登録し、ディス
パッチ処理を行う。その後、Elで割り込み許可にする
If there is a task in the waiting task queue, use DI to disable interrupts, delete the waiting task from the waiting task queue, change the status of the task from waiting to executable, and register the task in the ready queue. , performs dispatch processing. After that, use El to enable interrupts.

待ちタスクキューに待ちタスクが存在しなければ、セマ
フォビットをセットするだけで即ディスパッチ処理を行
う。
If there is no waiting task in the waiting task queue, dispatch processing is performed immediately by simply setting the semaphore bit.

オペレーティングシステムの設計の仕方にもよって詳細
は若干具なるが、セマフォに対する操作命令の基本的な
実現方法としては、以上説明したフローが一般的である
Although the details vary depending on how the operating system is designed, the flow described above is generally the basic method for implementing operation commands for semaphores.

発明が解決しようとする課題 上述したように、複数のタスクとオペレーティングシス
テムが、同一の処理装置上で動作する場合には、互いの
実行環境を壊さないように共有デ−タのアクセスなどに
注意を払いながらアルゴリズムを設計する必要がある。
Problems to be Solved by the Invention As mentioned above, when multiple tasks and operating systems run on the same processing device, care must be taken when accessing shared data so as not to destroy each other's execution environment. It is necessary to design the algorithm while paying for it.

例えば、第7図において割り込みが発生しては不都合が
生じる区間は、割り込みを不許可とし、オペレーティン
グシステムが管理するデータのアクセスに関して、複数
のタスクが競合することを避けている。
For example, in the section in FIG. 7 where an interrupt would cause inconvenience, interrupts are not permitted to prevent multiple tasks from competing with each other regarding access to data managed by the operating system.

もしフローの全区間割り込み許可状態であったとした場
合の不具合を、第8図を用いて以下に説明する。
The problem that would occur if interrupts were enabled for all sections of the flow will be explained below with reference to FIG.

第8図は、タスクlの実行中、セマフォに対するP命令
を発行し、P命令に対応するオペレーティングシステム
の処理中に、処理装置に備わっている割り込み゛システ
ムからの割り込みが発生し、割り込み処理ルーチンのプ
ログラム中で、同一セマフォに対するV命令を発行した
場合を示している。
FIG. 8 shows that during the execution of task l, a P instruction is issued to a semaphore, and during the operating system processing corresponding to the P instruction, an interrupt from the interrupt system provided in the processing unit occurs, and the interrupt processing routine This shows a case where a V instruction for the same semaphore is issued in the program.

第7図のINTの位置で割り込みが発生したとすると、
タスク1はP命令の処理の内のレディキュー操作以前の
状態であるので、セマフォのタスク待ちキューおよびレ
ディキューの両方に、P命令を発行したタスク1が登録
されたままの状態で、割り込み処理ルーチンに制御が移
ることになる。
Assuming that an interrupt occurs at the INT position in Figure 7,
Since task 1 is in the state before the ready queue operation in the P instruction processing, interrupt processing is performed while task 1, which issued the P instruction, is still registered in both the semaphore task waiting queue and ready queue. Control will be transferred to the routine.

この状態で、割り込み処理ルーチンからV命令が発行さ
れると、既に「待ちタスクあり」の状態であるため、タ
スク待ちキューからタスク1は削除され、タスクlのタ
スクステータスは実行可能状態となり、レディキューに
再度登録される。ところが、上記のP命令を発行したタ
スク1が、まだ実行状態としてレディキューに登録され
ているため、タスク1は、レディキューに2重登録され
てしまう。
In this state, when a V instruction is issued from the interrupt processing routine, task 1 is deleted from the task waiting queue because there is already a "waiting task" state, and the task status of task l becomes executable and ready. Requeued. However, since task 1, which issued the above-mentioned P command, is still registered in the ready queue as being in an execution state, task 1 is registered twice in the ready queue.

、割り込み処理ルーチンは、上記のV命令の処理が正常
に終了すれば、割り込みが正常終了したものとして、制
御をタスクlへ戻す。
, the interrupt handling routine returns control to task 1, assuming that the interrupt has ended normally if the processing of the V instruction described above is completed normally.

割り込み処理ルーチンから最初のタスク1に制御が戻る
と、第7図INTの次から処理を継続することになる。
When control is returned to the first task 1 from the interrupt processing routine, processing continues from INT in FIG.

タスク1は、割り込みが発生する以前の状態を継続して
、この処理を実行するため、タスク1のタスクステータ
スは、再び待ち状態に戻り、P命令処理中のレディキュ
ー操作により、レディキューから、タスクlの登録が削
除される。
Task 1 continues the state it was in before the interrupt occurred and executes this process, so the task status of task 1 returns to the waiting state again, and the ready queue operation during the P instruction processing causes the task to be read from the ready queue. The registration of task l is deleted.

しかし、このとき、既にレディキューには、タスク1が
2重登録となっているため、削除処理で誤動作すること
が予想される。
However, at this time, since task 1 has already been registered twice in the ready queue, it is expected that a malfunction will occur during the deletion process.

登録及び削除をどのような方法で実現するかに依って、
どの時点で、不具合が表面化するか異なってくるが、い
づれにしても、上記のようなP命令とV命令の組み合わ
せで、共通I10をアクセスする際の相互排除を実現す
る場合においては1、全区間を割り込み可能状態とする
ことは、上記のような誤動作を招くことになる。
Depending on how you implement registration and deletion,
The point at which the problem becomes apparent depends on the point in time, but in any case, when achieving mutual exclusion when accessing the common I10 using the above combination of P and V instructions, 1 and 1. Setting the section to an interrupt-enabled state will lead to the above-mentioned malfunction.

マルチプログラミングにおけるオペレーティングシステ
ムの処理においては、P命令、■命令に限らず上記の問
題が生じるため、非同期に発生する割り込みから処理を
保護するために、各所で割り込み禁止とするのが一般的
である。
In multiprogramming operating system processing, the above problem occurs not only with P instructions and ■ instructions, so it is common to disable interrupts in various places to protect processing from interrupts that occur asynchronously. .

−芳、マルチプログラミングを適用するアプリケーショ
ンプログラムは、処理性能が特に問題となる分野が多く
、割り込みに対する応答をリアルタイムで行わなければ
ならない場合がある。従って、いつでも割り込みを受け
つけられるようにオペレーティングシステムを設計する
ことが要求されている。
- Yoshihashi, application programs that apply multiprogramming have many fields in which processing performance is a particular problem, and there are cases where responses to interrupts must be made in real time. Therefore, there is a need to design operating systems so that they can accept interrupts at any time.

しかし、前述したようにマルチプログラミングを実現す
るために設計されるオペレーティングシステムは、その
機構上どうしても割り込みに対して処理を保護しなけれ
ばならない部分があり、そのため、割り込みに対する応
答性が低下するという問題点があった。
However, as mentioned above, operating systems designed to realize multiprogramming have some parts that must protect their processing from interrupts due to their mechanism, which causes the problem of reduced responsiveness to interrupts. There was a point.

従って、本発明の目的は、上記従来技術の問題点を解決
し、割り込みに対して高い応答性を示すマルチプログラ
ミング処理装置を提供することにある。
SUMMARY OF THE INVENTION Accordingly, an object of the present invention is to solve the problems of the prior art described above and to provide a multiprogramming processing device that exhibits high responsiveness to interrupts.

課題を解決するための手段 本発明に従うと、複数のタスクを並列に実行するマルチ
プログラミング処理装置において、オペレーティングシ
ステムが管理する各タスクに関するデータを操作する専
用命令を備え、且つ該専用命令の実行により前記データ
を操作したことを記憶する手段を備え、該記憶状態に基
づき、前記データの操作を許可、若しくは不許可にする
判定手段を備えたことを特徴とするマルチプログラミン
グ処理装置が提供される。
Means for Solving the Problems According to the present invention, a multiprogramming processing device that executes a plurality of tasks in parallel is provided with dedicated instructions for manipulating data related to each task managed by an operating system, and There is provided a multiprogramming processing device characterized by comprising means for storing information that the data has been manipulated, and determining means for permitting or disallowing the manipulation of the data based on the storage state.

昨月 本発明のマルチプログラミング処理装置は、従来、割り
込みから処理を保護するために、割り込み禁止区間を多
く設け、割り込みに対する応答性の低下を招いていたの
を改善するものである。
The multiprogramming processing device of the present invention is an improvement over the conventional multiprogramming processing device that provides many interrupt-disabled sections in order to protect processing from interrupts, resulting in a decrease in responsiveness to interrupts.

本発明のマルチプログラミング処理装置は、オペレーテ
ィングシステムが管理するデータを操作するための専用
命令と、管理データを操作したことを記iする手段によ
り、オペレーティングシステムの処理中、割り込みを極
力禁止状態にせず、割り込み応答性を向上させるという
独創的内容を有している。
The multiprogramming processing device of the present invention prevents interrupts from being disabled as much as possible during operating system processing by using dedicated instructions for manipulating data managed by the operating system and means for recording that the management data has been manipulated. , which has the original content of improving interrupt responsiveness.

すなわち、従来の処理装置では、あるタスクを処理中に
割り込みがかかり、割り込み処理ルーチン内で先のタス
クが使用中の同じIloにアクセスを行うと、複数のタ
スクが干渉し、誤作動を起こした。そのため、割り込み
が上記の誤作動を講究すると予想される部分は、割り込
み禁止としてこれを防止していた。
In other words, in conventional processing devices, if an interrupt occurs while a task is being processed and the same Ilo that is being used by the previous task is accessed within the interrupt processing routine, multiple tasks will interfere and cause malfunctions. . Therefore, parts where interrupts were expected to cause the above malfunction were prevented by disabling interrupts.

本発明の処理装置では、割り込み処理ルーチン内で先の
タスクが使用中の同じIloにアクセスを行った場合、
そのIloが使用中であるかどうかを記憶している記憶
手段の状態を最初に調べ、使用中は、判定手段がアクセ
スを不許可にする。
In the processing device of the present invention, if a previous task accesses the same Ilo that is in use within the interrupt processing routine,
First, the state of the storage means that stores whether the Ilo is in use is checked, and if the Ilo is in use, the determining means disallows access.

従って、割り込みを禁止しなくても、複数のタスクが干
渉することがない。
Therefore, even if interrupts are not prohibited, multiple tasks will not interfere with each other.

実施例 実施例1 第1図は、本発明のマルチプログラミング処理装置の一
例の構成図である。本実施例のマルチプログラミング処
理装置は、セマフォに対する「待ちキューへのタスク登
録命令」、「待ちキューからのタスク削除命令」および
「ディスパッチ命令」の3命令をマルチプログラミング
処理のための専用命令として有する。
Embodiments Embodiment 1 FIG. 1 is a block diagram of an example of a multiprogramming processing device of the present invention. The multiprogramming processing device of this embodiment has three instructions for the semaphore: "instruction to register task in waiting queue", "instruction to delete task from waiting queue", and "dispatch instruction" as dedicated instructions for multiprogramming processing. .

第1図に示した本発明のマルチプログラミング処理装置
は、上記の3専用命令を使用して、割り込み応答性が高
いマルチプログラミング処理を実現するための処理装置
の一例であり、データバス2に接続され、データを入出
力するレジスタ5、レジスタ5とセレクタ13を介し接
続されたALU4、ALU4の出力をラッチし、データ
バス2へ出力するテンポラリラッチ12で従来のコンビ
二一夕と同様なALU部が形成されている。
The multiprogramming processing device of the present invention shown in FIG. The ALU section is similar to the conventional combination unit with a register 5 that inputs and outputs data, an ALU 4 connected to the register 5 and a selector 13, and a temporary latch 12 that latches the output of the ALU 4 and outputs it to the data bus 2. is formed.

また1、少なくと°も上記のマルチプログラミングの3
専用命令のオペレーションコードを格納し、データバス
2を介して人力されるオペレーティングシステムの信号
により、所定の命令のオペレーションコードをエントリ
デコーダ7に出力する命令キュー6、命令キ5−6から
出力された命令のオペレーションコードをデコードし、
マイクロプログラムメ゛モリ9へのエントリアドレスを
生成するエントリデコーダ7、上記のマルチプログラミ
ングの3専用命令の処理の際、タスク待ちキューあるい
はレディキューのキュー構造の識別子、アボート先のア
ドレス等のデータを格納するオペランドバッファ8、オ
ペランドバッファ8のデータに基づきOSデータ管理部
11に選択信号を発生する選択信号発生部lOが制御部
に具備されている。
Also 1, at least 3 degrees of multiprogramming mentioned above.
The instruction queue 6 stores the operation code of a dedicated instruction, and outputs the operation code of a predetermined instruction to the entry decoder 7 in response to an operating system signal inputted manually via the data bus 2. Decode the operation code of the instruction,
The entry decoder 7, which generates the entry address to the microprogram memory 9, receives data such as the queue structure identifier of the task waiting queue or ready queue, the abort destination address, etc. when processing the 3 dedicated instructions for multiprogramming described above. The control section includes an operand buffer 8 to be stored and a selection signal generation section 10 that generates a selection signal to the OS data management section 11 based on the data in the operand buffer 8.

本実施例においては、専用命令は、総てマイクロプログ
ラムで処理される。
In this embodiment, all dedicated instructions are processed by microprograms.

待ちキューへのタスク登録命令の処理では、オペランド
バッファ8は、メモリ上に設定された待ちキューのキュ
ー構造の識別子、アボートした場合のアボート先のアド
レスをオペランドとする。
In processing an instruction to register a task in a waiting queue, the operand buffer 8 uses as operands the identifier of the queue structure of the waiting queue set on the memory and the address of the abort destination in the case of abort.

選択信号発生部10は、オペランドバッファ8に格納さ
れている待ちキューの識別子から、O3(オペレーティ
ングシステム)データ管理部11への選択信号を発生す
る。
The selection signal generation unit 10 generates a selection signal to the O3 (operating system) data management unit 11 from the identifier of the waiting queue stored in the operand buffer 8.

上記の選択信号を受けたOSデータ管理部11は、オペ
レーティングシステムが管理する各データ構造に対応す
るフラグを保持し、オペレーションシステムは、このフ
ラグの状態に応じてキュー操作を実行するか、あるいは
アボートする。すなわち、このフラグが、リセット状態
の場合は、操作可能であるため、待ちキューにタスク登
録処理を実行した後、対応するフラグをセット状態にす
る。
The OS data management unit 11 that receives the above selection signal holds flags corresponding to each data structure managed by the operating system, and the operating system executes the queue operation or aborts the queue operation depending on the state of the flag. do. That is, when this flag is in the reset state, it is operable, so after executing the task registration process in the waiting queue, the corresponding flag is set in the set state.

また、フラグがセット状態のときは、待ちキューは、操
作不可能であるため、オペランドバッファ8に格納され
たアボート先のアドレスからバスインターフェイス部3
を経て、アボートアドレスヘジャンプする。
Furthermore, when the flag is set, the waiting queue cannot be operated, so the bus interface section 3 starts from the abort destination address stored in the operand buffer 8.
then jump to the abort address.

待ちキューからのタスク削除命令の処理の場合は、登録
命令の場合と同様に、オペランドバッファ8は、オペラ
ンドとしてメモリ上に設定された待ちキューのキュー構
造の識別子およびアボートした場合のアボート先のアド
レスを格納する。
In the case of processing an instruction to delete a task from a waiting queue, as in the case of a registration instruction, the operand buffer 8 stores as an operand the identifier of the queue structure of the waiting queue set in memory and the address of the abort destination in the case of abort. Store.

オペレーションシステムは、OSデータ管理部11の状
態を判定し、オペランドバッファ8のオペランドで指定
された待ちキ二一に対応するフラグが、セット状態なら
アボートし、リセット状態なら待ちキューからタスクを
削除し、フラグをセットする。
The operating system determines the state of the OS data management unit 11, and if the flag corresponding to the wait queue specified by the operand of the operand buffer 8 is set, it aborts, and if it is reset, it deletes the task from the wait queue. , set the flag.

ディスパッチ命令では、オペランドバッファ8のオペラ
ンドとして、メモリ上に設定されたレディキューへのア
ドレスが格納され、オペレーションシステムは、このオ
ペランドに基づいて、レディキューの状態から、次に実
行状態に遷移させるタスクを選択するディスパッチ処理
を行い、OSデータ管理部11中の各データに対応した
フラグをリセット状態にする。
In the dispatch instruction, the address to the ready queue set on the memory is stored as an operand in the operand buffer 8, and based on this operand, the operating system selects a task to transition from the ready queue state to the next execution state. A dispatch process is performed to select the data, and the flags corresponding to each data in the OS data management unit 11 are reset.

第2図は、上記の3専用命令を備える第1図に示した処
理装置上で、専用命令を使用したP命令とV命令に対す
るオペレーティングシステムの処理の例である。
FIG. 2 is an example of the processing of the operating system for the P and V instructions using the dedicated instructions on the processing device shown in FIG. 1, which is equipped with the above three dedicated instructions.

P命令の処理において、待ちキューへのタスク登録命令
の処理では、登録処理を実行する前に、キュー操作可能
か否かの情報を保持するフラグを判定し、キュー操作可
能であれば登録処理を実行し、操作不可能であればキュ
ー操作を実行せずア゛ボートする。
In the processing of the P instruction, in the processing of the task registration instruction to the waiting queue, before executing the registration process, a flag that holds information on whether the queue operation is possible is determined, and if the queue operation is possible, the registration process is executed. Execute, and if the operation is not possible, abort without executing the queue operation.

■命令の処理の待ちキ二一からのタスク削除命令の処理
でも、登録命令と同様に、削除処理を実行する前に、キ
ュー操作可能か否かの情報を保持するフラグを判定し、
キュー操作可能であれば削除処理を実行し、操作不可能
であればキュー操作を実行せずアボートする。
■ Waiting for command processing Even when processing a task deletion command from the key 21, as with the registration command, before executing the deletion processing, a flag that holds information on whether queue operation is possible or not is determined,
If the queue operation is possible, delete processing is executed; if the queue operation is not possible, the queue operation is not executed and is aborted.

P命令の処理、■命令の処理のいずれの場合においても
ディスパッチ命令は、レディキューの状態から次に実行
状態に遷移させるタスクを選択する処理を行い、フラグ
をキュー操作可能状態にする。
In both the P instruction processing and the ■ instruction processing, the dispatch instruction selects the task to be next transitioned from the ready queue state to the execution state, and sets the flag to the queue operation enabled state.

第1図に示したような専用命令を備えた処理装置上で、
第2図に示したアルゴリズムでオペレーティングシステ
ムのP命令、■命令を設計することで、フローの全区間
を割り込み許可状態とすることができる。
On a processing device equipped with dedicated instructions as shown in Figure 1,
By designing the P and ■ instructions of the operating system using the algorithm shown in FIG. 2, the entire flow section can be enabled for interrupts.

以下、本実施例のマルチプログラミング処理装置に詔い
て、第8図に示したフローのように、り゛スク゛1あP
命°令°め処理中に割り込みが発生した場合を考えてみ
る。割り込みは第2図中に示した、INTの位置で発生
するとする。
Hereinafter, by instructing the multiprogramming processing device of this embodiment, as shown in the flow shown in FIG.
Consider the case where an interrupt occurs during instruction processing. It is assumed that an interrupt occurs at the INT position shown in FIG.

スナワチオペレーションシステムは、タスク1が発行し
たシステムコールP命令の処理を行っており、待ちキュ
ーへのタスク1の登録命令を実行し、OSデータ管理部
中の対応フラグをセット状態にする。また、タスク1の
ステータスを待ち状態に設定する。
The Sunawachi operation system is processing the system call P instruction issued by task 1, executes the instruction to register task 1 in the waiting queue, and sets the corresponding flag in the OS data management unit. Also, the status of task 1 is set to the waiting state.

割り込みが発生し、割り込み処理ルーチンに制御が移り
、割り込み処理ルーチン中でシステムコールV命令が発
行されると、第2図のV命令の処理ではセマフォに対す
る待ちタスクが存在する状態であるため、待ちキューか
らタスク削除命令を実行する。
When an interrupt occurs, control is transferred to the interrupt handling routine, and a system call V instruction is issued in the interrupt handling routine. Execute a task deletion instruction from the queue.

本実施例の装置では、削除命令を実行する際、まずその
キューに対応するOSデータ管理部中の管理フラグを判
定する。ここでは既に、セット状態であるため、実行を
アボートし、アボートアドレスヘジャンブする。
In the device of this embodiment, when executing a deletion command, first the management flag in the OS data management unit corresponding to the queue is determined. Since it is already in the set state here, execution is aborted and jumps to the abort address.

プロゲラ云゛及ジ支′テムコールを発行すると、通常、
制御が戻ってきた際に、システムコール処理の実行に関
する情報を、コンデイションコードとしてオペレーティ
ングシステムから返却される。
Issuing a progera and branch tem call typically
When control is returned, information regarding the execution of system call processing is returned from the operating system as a condition code.

このコンデイションコードは、一般的には特定のレジス
タに返却されるなどの形で、システムコールを発行した
プログラムに知らされる。
This condition code is generally notified to the program that issued the system call by being returned to a specific register.

従って、上記のように、プログラムがV命令を発行した
が、P命令の処理中であったためにその実行をアボート
された場合には、アボートされたことを示すコンデイシ
ョンコードが返却される。
Therefore, as described above, if a program issues a V instruction but its execution is aborted because it is processing a P instruction, a condition code indicating that the program has been aborted is returned.

割り込み処理ルーチンは、ルーチン内の処理が正常に終
了しなかったときには、その後の処理を継続せず、即割
り込み終了コードを実行し、P命令の割り込みが発生し
た時点に戻る。従って、上記の場合は、割り込み処理の
中で発行されたV命令がアボートされたため、割り込み
処理は終了し、直ちに割り込みが発生した時点に戻る。
When the processing within the routine does not end normally, the interrupt processing routine does not continue the subsequent processing, immediately executes the interrupt end code, and returns to the point at which the P instruction interrupt occurred. Therefore, in the above case, the V instruction issued during the interrupt processing is aborted, so the interrupt processing ends and immediately returns to the point at which the interrupt occurred.

本実施例の処理装置では、■命令の正常な処理は、割り
込みが発生したとき、セマフォに関してアクセスの競合
が起こらない場合にのみ実行される。
In the processing device of this embodiment, normal processing of the (1) instruction is executed only when an interrupt occurs and no access conflict occurs regarding the semaphore.

P命令の継続処理では、レディキューからの°タスク削
除操作を実行した後、ディスパッチ命令を実行する。デ
ィスパッチ命令では、OSデータ管理部中のセマフォの
待ちキューに対応する管理ビア)をリセット状態にし、
処理を終了する。
In the continuation processing of the P command, a dispatch command is executed after performing a task deletion operation from the ready queue. The dispatch command resets the management via corresponding to the semaphore waiting queue in the OS data management section,
Finish the process.

上記のような処理を行うことにより、システムコールP
命令、■命令の途中で割り込み禁止状態にせず、オペレ
ーティングシステムを記述することが可能となる。
By performing the above processing, system call P
It becomes possible to write an operating system without disabling interrupts in the middle of an instruction.

実施例2 マルチプログラミング処理においては、タスクは夫々独
立に動作しているため、タスク間でのデータの送受信が
しばしば必要となる。オペレーティングシステムはデー
タ送受信のための機能をサポートしており、システムコ
ールRBCBIVE−DATA 。
Embodiment 2 In multiprogramming processing, since each task operates independently, it is often necessary to send and receive data between tasks. The operating system supports functions for sending and receiving data, and the system call RBCBIVE-DATA.

5END−DATA命令がこれに当たる。本実施例では
、タスク間のデータ送受信をおこなう場合に、本発明の
処理装置を応用した。
This corresponds to the 5END-DATA command. In this embodiment, the processing device of the present invention is applied when transmitting and receiving data between tasks.

第3図に、タスク間でのデータ送受信の例を示す。タス
ク3は、シx f A :] −]ルRBcEIVE−
DATA命を発行することで、データを他のタスクから
受信する。システムコール発行時にデータが他のタスク
より送信されていない場合には、そのタスクは待ち状態
に遷移する。
FIG. 3 shows an example of data transmission and reception between tasks. Task 3 is:
Data is received from other tasks by issuing the DATA command. If no data has been sent from another task when the system call is issued, that task transitions to a wait state.

タスク4はシステムコール5BND−DATAを発行す
ることで、データを他のタスクに送信する。その時、既
に受信要求の待ちタスクがあった場合には、そのタスク
の待ち状態を解除し、データを送信する。待ちタスクが
ない場合には、送信データはキューに登録される。
Task 4 sends data to other tasks by issuing system call 5BND-DATA. At that time, if there is already a task waiting for a reception request, the task is released from the waiting state and the data is transmitted. If there are no waiting tasks, the transmission data is registered in the queue.

第4図は、シス7 A :1− ルRBcBIVB−D
ATA命令実行中に割り込みが発生し、割り込み処理ル
ーチン中で、送信用システムコールSBNローDATA
を発行した場合を示している。この場合のフローは、第
8図で示したP命令発行中に割り込みが発生し、割り込
み処理ルーチン中にV命令を発行した場合のフローと全
く同じである。
Figure 4 shows cis7A:1-ruRBcBIVB-D
An interrupt occurs during the execution of an ATA instruction, and in the interrupt processing routine, a transmission system call SBN low DATA is issued.
This shows the case where . The flow in this case is exactly the same as the flow shown in FIG. 8 when an interrupt occurs while the P instruction is being issued and the V instruction is issued during the interrupt processing routine.

本実施例の処理装置も実施例1で示した第1図のものと
同様な構造であり、「待ちキューへのタスク登録命令」
、「待ちキ二一からのタスク削除命令」および「ディス
パッチ命令」の3命令をマルチプログラミング処理のた
めの専用命令として有する。
The processing device of this embodiment also has a structure similar to that of FIG. 1 shown in Embodiment 1.
, "Delete task from waiting key 21 instruction" and "Dispatch instruction" as dedicated instructions for multiprogramming processing.

第5図に、本発明のマルチプログラミング処理装置上テ
実現した場合(7)RECEIVE−DATA命令とS
F!NローDATA命令のアルゴリズムで、フローの全
区間を割り込み許可状態とすることができる。
FIG. 5 shows the case (7) RECEIVE-DATA command and S
F! The N-row DATA instruction algorithm allows the entire flow section to be enabled for interrupts.

シスf A :l−ルR11iCBIVB−DATA命
令の処理中、受信データがない場合には、待ちキューへ
のタスク登録命令を実行し、タスクの待ちキューへの登
録、OSデータ管理部中の対応ビットをセット状態にす
る。そして、タスク3のステータスを待ち状態に設定す
る。
System f A: l-R11i During processing of the CBIVB-DATA command, if there is no received data, execute the task registration command to the waiting queue, register the task to the waiting queue, and register the corresponding bit in the OS data management section. Set state. Then, the status of task 3 is set to a waiting state.

割り込みが第5図中のINTの位置で発生し、割り込み
処理ルーチンに制御が移り、割り込み処理ルーチン中で
システムコール5END−DATA命令を発行すると、
第4図の5END−DAT人命令の処理では、デニタ受
信要求の待ちタスクが存在する状態であるため、待ちキ
ューからのタスク削除命令を実行する。削除命令では、
そのキューに対応するOSデータ管理部中の管理ビット
を判定する。ここでは既に、セット状態であるため、実
行をアボートし、アボートアドレスヘジャンプする。
When an interrupt occurs at the INT position in Figure 5, control is transferred to the interrupt handling routine, and a system call 5END-DATA instruction is issued in the interrupt handling routine.
In the processing of the 5END-DAT human command in FIG. 4, since there is a task waiting for a monitor reception request, a task deletion command from the waiting queue is executed. In the deletion order,
The management bit in the OS data management unit corresponding to the queue is determined. Since it is already in the set state here, execution is aborted and jumps to the abort address.

上記のように5END−DATA命令を発行したが、R
ECBIVB−DATA命令の処理中であったために実
行をアボートされた場合には、アボートされたことを示
すコンデイションコードが返却され、割り込み処理を継
続せず、即割り込み終了コードを実行し、RECBIV
B−DATA命令の割り込みが発生した時点に戻る。5
ENO−DATA命令の正常な処理は、割り込みが発生
した時、データ送受信に関してアクセスの競合が起こっ
ていない場合に実行される。
I issued the 5END-DATA command as above, but R
If execution is aborted because the ECBIVB-DATA instruction is being processed, a condition code indicating that it has been aborted is returned, the interrupt processing is not continued, the interrupt end code is immediately executed, and the RECBIV
The process returns to the point in time when the B-DATA instruction interrupt occurred. 5
Normal processing of the ENO-DATA instruction is executed if there is no access conflict regarding data transmission and reception when an interrupt occurs.

システムコールRBCEIVB−DATA命令の継続処
理では、レディキューからのタスク削除操作を実行した
後、ディスパッチ命令を実行する。ディスパッチ命令で
は、OSデータ管理部中の受信タスクの待ちキ二一1と
対応する管理ビットをリセット状態にし、処理を終了す
る。
In the continuation of the system call RBCEIVB-DATA instruction, a dispatch instruction is executed after a task is deleted from the ready queue. The dispatch command resets the management bit corresponding to the waiting key 11 of the reception task in the OS data management section, and ends the process.

従って、システムコールの処理の全区間で割り込み許可
状態であっても、誤動作せずに処理を進めることが可能
となる。
Therefore, even if interrupts are enabled during the entire system call processing period, the processing can proceed without malfunction.

発明の詳細 な説明してきたように、従来マルチプログラミングを実
現するためのオペレーティングシステム用として、オペ
レーティングシステムが管理するデータを特別に操作す
る専用命令がなかったために、共有データのアクセスの
競合などを回避する手段として、非同期に発生する割り
込みから、システムコールの処理の一部を保護するなど
の策をとってきた。
As explained in detail about the invention, conventional operating systems to achieve multiprogramming do not have dedicated instructions for specifically manipulating data managed by the operating system, thus avoiding conflicts in access to shared data. To do this, we have taken measures such as protecting part of the system call processing from asynchronous interrupts.

マルチプログラミング用のオペレーティングシステムは
、処理のリアルタイム性が要求され、特に割り込み応答
性は高くしなければならない。にも拘わらずオペレーテ
ィングシステムの構造上、割り込み禁止区間が大変多く
、時にシステムにとって重要な割り込みを受けつけられ
ず、システムの正常動作が期待出来なくなることがしば
しば発生する。
Operating systems for multiprogramming are required to perform real-time processing, and in particular must have high interrupt responsiveness. However, due to the structure of the operating system, there are a large number of interrupt-disabled sections, and interrupts important to the system are sometimes not accepted, often resulting in the system not being able to be expected to operate normally.

本発明は、簡単なハードウェアを追加した処理装置でオ
ペレーティングシステム用の特殊な専用命令を設けるこ
とで、各システムコール処理中、極力割り込み禁止区域
を少なくし、割り込み応答性を格段に高めるいう効果を
有する。
The present invention has the advantage that by providing special dedicated instructions for the operating system in a processing device with simple hardware added, the interrupt-prohibited area is minimized as much as possible during processing of each system call, and interrupt responsiveness is greatly improved. has.

【図面の簡単な説明】[Brief explanation of the drawing]

第1図は、本発明のマルチプログラミング処理装置の一
例のブロック図であり、 第2図は、本発明のマルチプログラミング処理装置の専
用命令を使用したP命令およびV命令の処理のフロー図
であり、 第3図は、タスク間のデータ送受信例であり、第4図は
、シx 7 ム:l−ルREcE4VIE−DAI:A
命令、5BNO−DATA命令と割り込み処理の関係を
示した図であり、 第5図は、本発明のマルチプログラミング処理装置の専
用命令を使用したRECBIVB−DATA命令および
5BNO−DATA命令の処理のフロー図であり、第6
図は、セマフォを用いたタスク間の共通I10のアクセ
ス例であり、 第7図は、従来のマルチプログラミング処理装置におけ
るP命令およびV命令のフロー図であり、第8図は、シ
ステムコールP命令、■命令と割り込み処理の関係を示
した図である。 〔主な参照番号〕 1・・アクセスバス、  2・・データバス、3・・バ
スインターフェイス部、 4・・ALU、   5・・汎用レジスタ群、6・・命
令キュー、7・・エントリデコーダ、8・・オペランド
バッファ、 9・・マイクロプログラムメモリ、 10・・選択信号発生部、 11・・OSデータ管理部、 12・・テンポラリラッチ、 13・・セレクタ、
FIG. 1 is a block diagram of an example of a multiprogramming processing device of the present invention, and FIG. 2 is a flow diagram of processing of P and V instructions using dedicated instructions of the multiprogramming processing device of the present invention. , FIG. 3 shows an example of data transmission and reception between tasks, and FIG. 4 shows an example of data transmission and reception between tasks.
5 is a diagram showing the relationship between instructions, 5BNO-DATA instructions, and interrupt processing. FIG. and the sixth
The figure shows an example of common I10 access between tasks using a semaphore, FIG. 7 is a flow diagram of P and V instructions in a conventional multiprogramming processing device, and FIG. 8 is a system call P instruction. , ■ is a diagram showing the relationship between instructions and interrupt processing. [Main reference numbers] 1. Access bus, 2. Data bus, 3. Bus interface unit, 4. ALU, 5. General purpose register group, 6. Instruction queue, 7. Entry decoder, 8. ...Operand buffer, 9..Microprogram memory, 10..Selection signal generation section, 11..OS data management section, 12..Temporary latch, 13..Selector.

Claims (1)

【特許請求の範囲】[Claims] 複数のタスクを並列に実行するマルチプログラミング処
理装置において、オペレーティングシステムが管理する
各タスクに関するデータを操作する専用命令を備え、且
つ該専用命令の実行により前記データを操作したことを
記憶する手段を備え、該記憶状態に基づき、前記データ
の操作を許可、若しくは不許可にする判定手段を備えた
ことを特徴とするマルチプログラミング処理装置。
A multiprogramming processing device that executes a plurality of tasks in parallel, comprising dedicated instructions for manipulating data related to each task managed by an operating system, and means for storing information that the data has been manipulated by executing the dedicated commands. . A multiprogramming processing device characterized by comprising a determining means for permitting or disallowing manipulation of the data based on the storage state.
JP1974788A 1988-01-30 1988-01-30 Multi-programming processor Pending JPH01195542A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP1974788A JPH01195542A (en) 1988-01-30 1988-01-30 Multi-programming processor

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP1974788A JPH01195542A (en) 1988-01-30 1988-01-30 Multi-programming processor

Publications (1)

Publication Number Publication Date
JPH01195542A true JPH01195542A (en) 1989-08-07

Family

ID=12007930

Family Applications (1)

Application Number Title Priority Date Filing Date
JP1974788A Pending JPH01195542A (en) 1988-01-30 1988-01-30 Multi-programming processor

Country Status (1)

Country Link
JP (1) JPH01195542A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2009070043A (en) * 2007-09-12 2009-04-02 National Institute Of Advanced Industrial & Technology Block avoidance method in real-time task
WO2010086357A1 (en) 2009-01-28 2010-08-05 Shell Internationale Research Maatschappij B.V. Anti-wear agent and lubricating composition with superior anti-wear properties containing same

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS57207957A (en) * 1981-06-16 1982-12-20 Ibm Resource control system

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS57207957A (en) * 1981-06-16 1982-12-20 Ibm Resource control system

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2009070043A (en) * 2007-09-12 2009-04-02 National Institute Of Advanced Industrial & Technology Block avoidance method in real-time task
WO2010086357A1 (en) 2009-01-28 2010-08-05 Shell Internationale Research Maatschappij B.V. Anti-wear agent and lubricating composition with superior anti-wear properties containing same

Similar Documents

Publication Publication Date Title
JP4759273B2 (en) Data processing apparatus and shared resource access control method
KR100242484B1 (en) Method and device for performance optimization of cache memory system
US5701493A (en) Exception handling method and apparatus in data processing systems
US6141734A (en) Method and apparatus for optimizing the performance of LDxL and STxC interlock instructions in the context of a write invalidate protocol
KR100976280B1 (en) Multiprocessor and multithreaded safety message queue with hardware support
US5499356A (en) Method and apparatus for a multiprocessor resource lockout instruction
US5333297A (en) Multiprocessor system having multiple classes of instructions for purposes of mutual interruptibility
US5966543A (en) Method of using collaborative spinlocks to provide exclusive access to a resource in a multiprocessor computer system
JPH0535453B2 (en)
JPH08278886A (en) Method and system for operation of extended system management in data-processing system
JPS58151655A (en) Information processing device
JPH0535454B2 (en)
JPH0324696B2 (en)
JPH0816870B2 (en) System for draining the instruction pipeline
US5291581A (en) Apparatus and method for synchronization of access to main memory signal groups in a multiprocessor data processing system
JPH03196249A (en) multiprocessor system
JPH1115793A (en) Protection method for resource maintainability
JPH04182858A (en) Shared memory management system
EP0230350B1 (en) Protection of data in a multiprogramming data processing system
JPH04155465A (en) File sharing method
JP4130465B2 (en) Technology for executing atomic processing on processors with different memory transfer processing sizes
JPH01195542A (en) Multi-programming processor
CA1302580C (en) Apparatus and method for using lockout for synchronization of access to main memory signal groups in a multiprocessor data processing system
US11734051B1 (en) RTOS/OS architecture for context switching that solves the diminishing bandwidth problem and the RTOS response time problem using unsorted ready lists
JP3381079B2 (en) Exclusive control system using cache memory