JPH05342019A - Processor device - Google Patents
Processor deviceInfo
- Publication number
- JPH05342019A JPH05342019A JP14935592A JP14935592A JPH05342019A JP H05342019 A JPH05342019 A JP H05342019A JP 14935592 A JP14935592 A JP 14935592A JP 14935592 A JP14935592 A JP 14935592A JP H05342019 A JPH05342019 A JP H05342019A
- Authority
- JP
- Japan
- Prior art keywords
- task
- event
- tasks
- flag
- occurrence
- 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
Links
Abstract
(57)【要約】
【目的】 個々のタスク実行に要する時間が短く、該時
間に比べて前記イベント発生時等でのOSの処理時間が
無視できなくなるような場合での、当該プロセッサ装置
全体での処理効率を向上する。
【構成】 イベント発生フラグ20は、各タスクT1〜
Tm がイベント発生の有無を読出し可能なフラグであ
る。イベント発生受付手段10は、イベントE1〜En
それぞれの発生時に、これに対応する前記イベント発生
フラグ20をセットする。タスク切換手段14は、前記
複数のタクスT1〜Tm を、それぞれのタスクT1〜T
m の実行権放棄毎に、予め定められた順序で順次ラン状
態に切換える。前記イベント発生受付手段10や前記タ
スク切換手段14等のオペレーティングシステム側での
処理を低減し、全体の処理効率を向上することができ
る。
(57) [Abstract] [Purpose] In the case where the time required to execute each task is short and the processing time of the OS at the time of occurrence of the event cannot be ignored compared to the time, the whole processor device concerned Improve the processing efficiency of. [Arrangement] The event occurrence flag 20 is for each task T1 to
Tm is a flag that can read whether or not an event has occurred. The event occurrence receiving means 10 uses the events E1 to En.
At each occurrence, the event occurrence flag 20 corresponding to this is set. The task switching means 14 assigns the tasks T1 to Tm to the tasks T1 to Tm.
Every time the execution right of m is abandoned, the run state is sequentially switched in a predetermined order. The processing on the operating system side such as the event occurrence receiving means 10 and the task switching means 14 can be reduced, and the overall processing efficiency can be improved.
Description
【0001】[0001]
【産業上の利用分野】本発明は、イベント発生等に伴っ
て、ラン状態となるタスクを切換え、マルチタスキング
を実現したプロセッサ装置に係り、特に、個々のタスク
実行に要する時間が短く、該時間に比べて前記イベント
発生時等でのOS(operating system)の処理時間が無
視できなくなるような場合での、当該プロセッサ装置全
体での処理効率を向上することができるプロセッサ装置
に関する。BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a processor device which realizes multitasking by switching tasks which are in a run state in accordance with the occurrence of an event, and in particular, the time required to execute each task is short. The present invention relates to a processor device capable of improving the processing efficiency of the entire processor device when the processing time of an OS (operating system) at the time of the occurrence of an event cannot be ignored as compared with time.
【0002】[0002]
【従来の技術】ベル研究所で開発されたTSS(time s
haring system )用汎用OSであるUNIXは、マルチ
ユーザ・マルチタスキング環境が提供されている。複数
のユーザは、コンピュータ資源をタイムシェアリングし
ながら、複数のタスクを実行させることができる。又、
このようなマルチタスキング機能は、前記UNIXだけ
でなく、様々なOS、例えば前記UNIX等のようなオ
ペレータの利用を主とした目的とするマルチユーザ用O
Sや、計測機器や通信装置、更には様々な機械等を制御
するために用いるリアルタイムOS等でも実現されてい
る。2. Description of the Related Art TSS (time s) developed at Bell Laboratories
UNIX, which is a general-purpose OS for haring system), provides a multi-user multi-tasking environment. Multiple users can perform multiple tasks while time-sharing computer resources. or,
Such a multi-tasking function is intended not only for the UNIX but also for various OSs, such as the UNIX, which is mainly used by operators such as the UNIX.
It is also realized by S, a measuring instrument, a communication device, a real-time OS used for controlling various machines, and the like.
【0003】図6は、従来のマルチタスキング機能を有
するマルチプロセッサ装置のタスク状態の状態遷移図で
ある。FIG. 6 is a state transition diagram of task states of a conventional multiprocessor device having a multitasking function.
【0004】この図6においては、従来のプロセッサ装
置で各タスクが取る状態、即ちラン状態C11、レディ
状態C12、アイドル状態C13、ウェイト状態C14
及びヌル状態C15が示されている。In FIG. 6, the states taken by each task in the conventional processor device, that is, the run state C11, the ready state C12, the idle state C13, and the wait state C14 are shown.
And a null state C15 is shown.
【0005】前記ラン状態C11(実行状態)は、該当
タスクが実際にCPU(central processing unit )を
占有しており、該タスクを構成するプログラムが実行中
となっている状態である。前記レディ状態C12(実行
可能状態)は、該当するタスクが利用する諸資源が確保
され、CPUの割付待ちとなっている状態である。前記
アイドル状態C13(終了状態)は、該タスクの実行の
ための環境を準備している。あるいは該タスクの実行が
終了し、資源の解放準備をしている状態である。前記ウ
ェイト状態C14(待ち状態)は、諸資源の確保など特
定のイベント発生等を待つために、CPUの占有が放棄
された状態である。前記ヌル状態C15は、マルチタス
キング機能を有するOSが、該タスクの存在を認識して
いない状態である。The run state C11 (execution state) is a state in which the corresponding task actually occupies the CPU (central processing unit) and the programs constituting the task are in execution. The ready state C12 (executable state) is a state in which various resources used by the corresponding task are secured and the CPU is waiting for allocation. The idle state C13 (end state) prepares an environment for execution of the task. Alternatively, it is in a state where the execution of the task is completed and preparations for releasing resources are made. The wait state C14 (waiting state) is a state in which the occupation of the CPU is abandoned in order to wait for the occurrence of a specific event such as securing various resources. The null state C15 is a state in which the OS having the multitasking function does not recognize the existence of the task.
【0006】このようなマルチタスキング機能を有する
プロセッサ装置によれば、例えば前述のようなマルチユ
ーザ用OSを実現することができ、又、比較的規模の大
きな計測機器や通信制御装置等のリアルタイム制御の実
現の便宜を図ることができる。According to the processor device having such a multi-tasking function, for example, the above-mentioned multi-user OS can be realized, and the real-time operation of a relatively large measuring device or communication control device can be realized. It is possible to realize the convenience of control.
【0007】[0007]
【発明が達成しようとする課題】しかしながら、前記U
NIX等、マルチタスキング機能を有する従来のOSに
おいては、マルチタスキング機能を実現するためのOS
の処理を実行するためのCPU占有時間が問題となって
しまうことがあった。例えば、イベント発生等に伴っ
て、ラン状態となるタスクを切り換えたり、対象となる
各タスクのタスク状態を切り換える処理時間が問題とな
ってしまうことがあった。However, the above-mentioned U
In a conventional OS having a multitasking function such as NIX, an OS for realizing the multitasking function
Occasionally, the CPU occupancy time for executing the above process may become a problem. For example, the processing time for switching the task in the run state or switching the task state of each target task may become a problem due to the occurrence of an event.
【0008】例えば、前記UNIXでは、あるイベント
が発生すると、該イベントを持っている複数のタスクが
ある場合には、OSはこれら複数のタスクを全て一旦レ
ディ状態C12に遷移させる。この後、これら複数のタ
スクのうち1つのタスクのみをラン状態C11とする。
又、該ラン状態となったタスクが該イベントに関する資
源を占有すると、OSは、残りのタスクを再びウェイト
状態C14(イベント待ち状態)に遷移させる。For example, in UNIX, when a certain event occurs, when there are a plurality of tasks having the event, the OS temporarily transits all of the plurality of tasks to the ready state C12. After that, only one of the plurality of tasks is set to the run state C11.
When the task in the run state occupies the resource related to the event, the OS again shifts the remaining tasks to the wait state C14 (event waiting state).
【0009】又、前記UNIXにおいて、あるタスクに
よって行われていた処理に異常が発生した場合や、種々
のエラー発生時等、例外イベント発生時には、これに関
係する他のタスクに対してシグナルを送り、該イベント
発生を通知する。該通知を受け取ったタスクがウェイト
状態C14であれば、OSは該タスクをレディ状態C1
2に遷移させる。又、このような例外イベントに関係す
るタスクが複数ある場合には、OSはこのような処理を
複数のタスクに対して行う。In the UNIX, when an abnormality occurs in the processing performed by a task or when an exception event occurs such as when various errors occur, a signal is sent to other tasks related to this. , Notifies the occurrence of the event. If the task receiving the notification is in the wait state C14, the OS sets the task in the ready state C1.
Transition to 2. Also, when there are a plurality of tasks related to such an exception event, the OS performs such processing for a plurality of tasks.
【0010】このように、前記UNIX等マルチタスキ
ング機能を有する従来のOSでは、該マルチタスキング
機能に関する処理時間が問題となってしまうことがあっ
た。特に、マルチタスキングによって実行されるそれぞ
れのタスクの実行に要する時間が比較的短い場合には、
OSのマルチタスキング機能に関する処理時間が無視で
きない問題となってしまう。As described above, in the conventional OS having the multitasking function such as UNIX, the processing time related to the multitasking function sometimes becomes a problem. Especially when the time required to execute each task executed by multitasking is relatively short,
The processing time for the multitasking function of the OS becomes a problem that cannot be ignored.
【0011】本発明は、前記従来の問題点を解決するべ
く成されたもので、イベント発生等に伴って、ラン状態
となるタスクを切り換え、マルチタスキングを実現した
プロセッサ装置において、個々のタスク実行に要する時
間が短く、該時間に比べて前記イベント発生時等でのO
Sの処理時間が無視できなくなるような場合でも、当該
プロセッサ装置全体での処理効率を向上することができ
るプロセッサ装置を提供することを目的とする。The present invention has been made to solve the above-mentioned conventional problems. In the processor device which realizes multi-tasking by switching the tasks which are in the run state in accordance with the occurrence of an event or the like, the individual tasks are executed. The time required for execution is short, and the O
An object of the present invention is to provide a processor device capable of improving the processing efficiency of the entire processor device even when the processing time of S cannot be ignored.
【0012】[0012]
【課題を達成するため手段】本発明はイベント発生等に
伴って、ラン状態となるタスクを切換え、マルチタスキ
ングを実現したプロセッサ装置において、各タスクがイ
ベント発生の有無を読出し可能なイベント発生フラグを
有する記憶手段と、イベント発生時には、これに対応す
る前記イベント発生フラグをセットするイベント発生受
付手段と、前記複数のタスクを、それぞれのタスクの実
行権放棄の毎に、予め定められた順序で順次ラン状態に
切り換えるタスク切換手段とを備え、各タスクでの前記
イベントに対応する処理は、それぞれのタスクで前記イ
ベント発生フラグを確認しながら実行することにより、
前記課題を達成したものである。SUMMARY OF THE INVENTION According to the present invention, in a processor device which realizes multitasking by switching tasks which are in a run state in accordance with the occurrence of an event or the like, an event occurrence flag by which each task can read the presence or absence of the event occurrence. A storage unit having an event occurrence reception unit that sets the event occurrence flag corresponding to the event occurrence time, and the plurality of tasks in a predetermined order for each execution of the task execution rights. A task switching means for sequentially switching to a run state, and processing corresponding to the event in each task is executed by confirming the event occurrence flag in each task,
The above object has been achieved.
【0013】[0013]
【作用】本発明は、個々のタスク実行に要する時間が短
く、該時間に比べて前記イベント発生時等でのOSの処
理時間が無視できなくなるような場合について、このよ
うな場合でのプロセッサ装置全体での処理効率を向上す
るため、各タスクで行う処理内容と、OSで行う処理内
容とを吟味して成されたものである。即ち、各タスクで
行う処理とOS側で行う処理との分担を見直すことによ
り、プロセッサ装置全体での処理効率を向上させてい
る。The present invention relates to a case where the time required for executing each task is short and the processing time of the OS at the time of occurrence of the event cannot be ignored as compared with the time, and the processor device in such a case is used. In order to improve the overall processing efficiency, the processing contents performed by each task and the processing contents performed by the OS are carefully examined. That is, the processing efficiency of the entire processor device is improved by reassessing the sharing of the processing performed by each task and the processing performed by the OS.
【0014】図1は、本発明の要旨を示すブロック図で
ある。FIG. 1 is a block diagram showing the gist of the present invention.
【0015】この図1に示されるように、本発明のプロ
セッサ装置の特徴部は、イベント発生受付手段10と、
イベント発生フラグ20を有する所定の記憶手段と、タ
スク切換手段14である。又、本発明のプロセッサ装置
では、複数のタスクT1〜Tn を含むタスク群Tが実行
される。As shown in FIG. 1, the processor of the present invention is characterized by an event occurrence receiving means 10 and
A predetermined storage means having an event occurrence flag 20 and a task switching means 14. Further, in the processor device of the present invention, a task group T including a plurality of tasks T1 to Tn is executed.
【0016】前記イベント発生フラグ20は、前記タス
クT1〜Tn が、イベント発生の有無を読出し可能なフ
ラグである。即ち、該イベント発生フラグ20は、これ
らタスクT1〜Tn が読出し可能な記憶手段に、例えば
あるイベントに対応するアドレスに「1」がセットされ
ていれば該イベント発生有りとし、「0」であれば発生
無しとするというようなものである。The event occurrence flag 20 is a flag that allows the tasks T1 to Tn to read out whether or not an event has occurred. That is, the event occurrence flag 20 indicates that the event has occurred and is "0" if, for example, "1" is set in the address corresponding to an event in the storage means from which the tasks T1 to Tn can be read. For example, it means that there is no occurrence.
【0017】前記イベント発生受付手段10は、イベン
トE1〜En の発生時には、これに対応する前記イベン
ト発生フラグ20の所定アドレスのフラグをセットす
る。例えば、あるイベントE1〜En がプロセッサ装置
の外部からのものである場合には、該イベント発生受付
手段10は、ハードウェア割込みにより起動され、その
イベントE1〜En の発生により該当フラグをセットす
る。又、例えば、発生するイベントE1〜En が内部で
発生するものである場合には、ソフトウェア割込みによ
り該イベント発生手段10は起動され、該当するフラグ
をセットする。When the events E1 to En occur, the event occurrence accepting means 10 sets a flag at a predetermined address of the event occurrence flag 20 corresponding to the event. For example, when a certain event E1 to En is from the outside of the processor device, the event occurrence receiving means 10 is activated by a hardware interrupt and sets the corresponding flag upon occurrence of the event E1 to En. Further, for example, when the generated events E1 to En are internal, the event generating means 10 is activated by a software interrupt and sets the corresponding flag.
【0018】前記タスク切換手段14は、前記複数のタ
スクT1〜Tn を、それぞれのタスクの実行権放棄の度
に、予め定められた順序で順次ラン状態C11に切り換
える。即ち、ラン状態C11であったあるタスクが実行
権を放棄すると、該タスク切換手段14は、実行権を放
棄した該タスクの次にラン状態C11となることが予め
定められていた別のタスクをラン状態C11とする。The task switching means 14 sequentially switches the plurality of tasks T1 to Tn to the run state C11 in a predetermined order each time the execution right of each task is abandoned. That is, when a certain task in the run state C11 relinquishes the execution right, the task switching unit 14 determines another task which is predetermined to be in the run state C11 next to the task for which the execution right is relinquished. The run state C11 is set.
【0019】なお、この図1において、前記イベント発
生受付手段10及び前記タスク切換手段14は、例えば
OS内での処理により実現してもよい。本発明は、これ
を限定するものではない。即ち、これらイベント発生受
付手段10及びタスク切換手段14は、前記複数のタス
クT1〜Tn に対して予め設けられた手段であればよ
い。Note that, in FIG. 1, the event occurrence receiving means 10 and the task switching means 14 may be realized, for example, by processing within the OS. The present invention does not limit this. That is, the event occurrence receiving means 10 and the task switching means 14 may be means provided in advance for the plurality of tasks T1 to Tn.
【0020】以上説明したように、本発明によれば、イ
ベント発生時に行われる処理は、該イベント発生に対応
する前記イベント発生フラグ20のセットのみである。
又、各タスクT1〜Tn で行う処理も、それぞれのタス
クT1〜Tn が必要とする前記イベント発生フラグ20
のみを読み出せばよいので、比較的処理時間が短い処理
である。従って、本発明によれば、プロセッサ装置全体
での処理効率を向上することができる。As described above, according to the present invention, the processing performed when an event occurs is only the setting of the event occurrence flag 20 corresponding to the event occurrence.
Further, the processing performed by each of the tasks T1 to Tn also requires the event occurrence flag 20 required by each of the tasks T1 to Tn.
This is a process in which the processing time is relatively short because only the read-out is required. Therefore, according to the present invention, the processing efficiency of the entire processor device can be improved.
【0021】[0021]
【実施例】以下、図を用いて本発明の実施例を詳細に説
明する。Embodiments of the present invention will be described in detail below with reference to the drawings.
【0022】図2は、本発明の実施例の構成を示すブロ
ック図である。FIG. 2 is a block diagram showing the configuration of the embodiment of the present invention.
【0023】この図2では、ネットワークN1とネット
ワークN2とを接続するネットワーク間接続装置である
プロセッサ装置が示されている。該ネットワーク間接続
装置は、これら2つのネットワークN1、N2間での複
数の通信を同時に行うことができるようになっている。In FIG. 2, a processor device which is an inter-network connection device for connecting the network N1 and the network N2 is shown. The inter-network connection device can simultaneously perform a plurality of communications between these two networks N1 and N2.
【0024】該ネットワーク間接続装置は、受信要求フ
ラグ20a と、回線異常フラグ20b と、中継依頼フラ
グ20c と、送信依頼フラグ20d と、使用可能バッフ
ァ存在フラグ20e とでなるイベント発生フラグ20を
有している。又、該ネットワーク間接続装置は、回線イ
ンタフェース30と、タスク実行権制御部32と、バッ
ファ管理部34と、送受信バッファ36とを有してい
る。又、該ネットワーク間接続装置において、前記ネッ
トワークN1と前記ネットワークN2との間の通信処理
は、主として、複数の受信タスクTR1〜TRn と、1
つの中継タスクTTと、複数の送信タスクTS1〜TS
n とによって成される。The inter-network connecting device has an event occurrence flag 20 consisting of a reception request flag 20a, a line abnormality flag 20b, a relay request flag 20c, a transmission request flag 20d, and an available buffer existence flag 20e. ing. Further, the inter-network connection device has a line interface 30, a task execution right control unit 32, a buffer management unit 34, and a transmission / reception buffer 36. Further, in the inter-network connecting device, the communication processing between the network N1 and the network N2 is mainly performed by a plurality of receiving tasks TR1 to TRn and 1
One relay task TT and a plurality of transmission tasks TS1 to TS
formed by n and.
【0025】前記受信要求フラグ20a 及び前記回線異
常フラグ20b は、前記回線インタフェース30で種々
の原因によりハードウェア割込みが発生すると、該回線
インタフェース30用に備えられたOSのドライバプロ
グラムにより該当フラグがセットされる。例えば、前記
回線インタフェース30内の受信バッファに前記ネット
ワークN1あるいはN2からの受信データが取り込まれ
ると、該当する前記受信要求フラグ20a 中の1つのフ
ラグがセットされる。あるいは、前記ネットワークN1
あるいはN2で行われているある通信に異常が発生した
り、あるいは、これらネットワークN1あるいはN2自
体に異常が発生すると、発生した異常に対応する前記回
線異常フラグ20b のフラグがセットされる。The reception request flag 20a and the line abnormality flag 20b are set by the driver program of the OS provided for the line interface 30 when a hardware interrupt occurs in the line interface 30 due to various causes. To be done. For example, when reception data from the network N1 or N2 is fetched into the reception buffer in the line interface 30, one of the corresponding reception request flags 20a is set. Alternatively, the network N1
Alternatively, if an abnormality occurs in a certain communication performed in N2, or if an abnormality occurs in the network N1 or N2 itself, the line abnormality flag 20b corresponding to the abnormality that has occurred is set.
【0026】前記中継依頼フラグ20c は、前記受信タ
スクTR1〜TRn と前記中継タスクTTとの間での中
継依頼伝達に用いられる。該中継依頼フラグ20c は、
前記受信タスクTR1〜TRn でセットされ、前記中継
タスクTTにて読み出される。前記送信依頼フラグ20
d は、前記中継タスクTTと前記送信タスクTS1〜T
Sn との間での送信依頼伝達に用いられる。該送信依頼
フラグ20d は、前記中継タスクTTにてセットされ、
前記送信タスクTS1〜TSn にて読み出される。The relay request flag 20c is used for transmitting a relay request between the receiving tasks TR1 to TRn and the relay task TT. The relay request flag 20c is
It is set by the receiving tasks TR1 to TRn and read by the relay task TT. The transmission request flag 20
d is the relay task TT and the transmission tasks TS1 to T
It is used to transmit a transmission request with Sn. The transmission request flag 20d is set by the relay task TT,
It is read by the transmission tasks TS1 to TSn.
【0027】前記使用可能バッファ存在フラグ20e
は、前記受信タスクTR1〜TRn 及び前記送信タスク
TS1〜TSn において、各時点における前記送受信バ
ッファ36の空バッファエリアの有無を検知するために
用いられる。該使用可能バッファ存在フラグ20e は、
前記バッファ管理部34で前記送受信バッファ36の中
のエリアが前記受信タスクTR1〜TRn あるいは前記
送信タスクTS1〜TSn に割り付けられると、該エリ
アに対応するフラグがセットされる。Available buffer existence flag 20e
Are used to detect the presence / absence of an empty buffer area of the transmission / reception buffer 36 at each time in the reception tasks TR1 to TRn and the transmission tasks TS1 to TSn. The available buffer existence flag 20e is
When the buffer management unit 34 allocates an area in the transmission / reception buffer 36 to the reception tasks TR1 to TRn or the transmission tasks TS1 to TSn, a flag corresponding to the area is set.
【0028】前記タスク実行権制御部32は、前記受信
タスクTR1〜TRn 、前記中継タスクTT及び前記送
信タスクTS1〜TSn について、それぞれのタスクの
タスク状態の切換え等のタスク実行権に関する処理を行
う。前記送受信バッファ36は、前記受信タスクTR1
〜TRn が前記回線インタフェース30から受信データ
を受け取る際に用いたり、前記送信タスクTS1〜TS
n が前記回線インタフェース30から送信する際に用い
るバッファエリアを提供する。該送受信バッファ36
は、等しいバッファ容量の合計6個のバッファエリアを
有している。The task execution right control unit 32 performs processing related to the task execution right such as switching the task state of each of the reception tasks TR1 to TRn, the relay task TT, and the transmission tasks TS1 to TSn. The transmission / reception buffer 36 uses the reception task TR1.
~ TRn are used when receiving received data from the line interface 30, and the transmission tasks TS1 to TS
It provides a buffer area used when n transmits from the line interface 30. The transmission / reception buffer 36
Has a total of 6 buffer areas of equal buffer capacity.
【0029】前記受信タスクTR1〜TRn は、それぞ
れ、ラン状態C11となると前記受信要求フラグ20a
により、前記ネットワークN1あるいは前記ネットワー
クN2からの受信の有無をチェックする。受信有りが確
認されると、該受信タスクTR1〜TRn は、前記使用
可能バッファ存在フラグ20e により、前記送受信バッ
ファ36の空エリアの有無をチェックする。空エリアが
確認されると、前記バッファ管理部34に対して受信バ
ッファ要求を行い、受信バッファを獲得した後に受信処
理を実行する。前記ネットワークN1あるいはN2で行
われる通信のプロトコルによっては、受信処理が完了し
たときにこの受信完了通知を通信の送信元へ送信しなけ
ればならないものもある。この場合には、前記受信バッ
ファを獲得した後の受信処理終了後に、該受信完了通知
を送信する。又、該受信処理では、ネットワークN1あ
るいはN2から送られてきたデータを、獲得した受信バ
ッファに格納すると共に、そのデータの正当性のチェッ
ク等を行い、又、常にネットワークN1あるいはN2の
回線異常を前記回線異常フラグ20b により監視する。
又、該受信処理の終了時には、前記中継依頼フラグ20
c の該当するフラグをセットし、前記中継タスクTTに
中継処理依頼を行う。When the receiving tasks TR1 to TRn enter the run state C11, the receiving request flag 20a is received.
The presence / absence of reception from the network N1 or the network N2 is checked by. When the reception is confirmed, the reception tasks TR1 to TRn check the availability of the available buffer existence flag 20e to see if there is an empty area in the transmission / reception buffer 36. When the empty area is confirmed, a reception buffer request is made to the buffer management unit 34, and the reception process is executed after the reception buffer is acquired. Depending on the protocol of the communication performed in the network N1 or N2, there is a protocol in which the reception completion notification must be transmitted to the transmission source of the communication when the reception processing is completed. In this case, the reception completion notification is transmitted after the reception process ends after the reception buffer is acquired. Further, in the reception processing, the data sent from the network N1 or N2 is stored in the acquired reception buffer, the validity of the data is checked, and the line abnormality of the network N1 or N2 is constantly checked. The line abnormality flag 20b is used for monitoring.
At the end of the reception process, the relay request flag 20
A corresponding flag of c is set and a relay processing request is made to the relay task TT.
【0030】前記中継タスクTTは、前記ラン状態C1
1となると、前記中継依頼フラグ20c を読み出すこと
により、前記受信タスクTR1〜TRn からの中継処理
依頼を監視する。中継処理依頼があると、該中継タスク
TTは、該中継処理依頼となったデータの中継先から判
断して、該当する前記送信タスクTS1〜TSn に対し
て送信依頼を行うため、該当する前記送信依頼フラグ2
0d をセットする。The relay task TT uses the run state C1.
When it becomes 1, the relay processing request from the receiving tasks TR1 to TRn is monitored by reading the relay request flag 20c. When there is a relay processing request, the relay task TT makes a transmission request to the corresponding transmission tasks TS1 to TSn, judging from the relay destination of the data for which the relay processing request has been made, so the corresponding transmission task Request flag 2
Set 0d.
【0031】前記送信タスクTS1〜TSn は、前記ラ
ン状態C11となると前記送信依頼フラグ20d をチェ
ックし、前記中継タスクTTからの送信依頼の有無を確
認する。送信依頼があると、該送信タスクTS1〜TS
n は、前記使用可能バッファ存在フラグ20e を読み出
すことにより、前記送受信バッファ36中に送信バッフ
ァとして利用できる空エリアがあるか確認する。空エリ
アがあると、前記バッファ管理部34を介して送信バッ
ファを獲得し、送信データのセットを行って前記回線イ
ンタフェース30からの送信を行う。前記ネットワーク
N1やN2で行われる通信のプロトコルによっては、送
信処理完了後に相手からの受信完了通知を受け取るもの
があるが、このような処理を前記送信タスクTS1〜T
Sn が行う。なお、該送信タスクTS1〜TSn での送
信処理中には、前記回線異常フラグ20b を読み出すこ
とにより、常に前記ネットワークN1やN2の回線異常
等を監視する。When the transmission tasks TS1 to TSn enter the run state C11, the transmission tasks TS1 to TSn check the transmission request flag 20d to confirm whether or not there is a transmission request from the relay task TT. When there is a transmission request, the transmission tasks TS1 to TS
By reading the available buffer existence flag 20e, n confirms whether or not there is an empty area available as a transmission buffer in the transmission / reception buffer 36. If there is an empty area, a transmission buffer is acquired via the buffer management unit 34, transmission data is set, and transmission from the line interface 30 is performed. Depending on the protocol of communication performed in the network N1 or N2, there is one that receives a reception completion notification from the other party after the completion of the transmission processing. Such processing is performed by the transmission tasks TS1 to T1.
Sn does. During the transmission processing in the transmission tasks TS1 to TSn, the line abnormality flag 20b is read to constantly monitor the line abnormality of the networks N1 and N2.
【0032】図3は、前記実施例の実行可能状態タスク
待ち行列の構造を示す線図である。FIG. 3 is a diagram showing the structure of the ready task queue of the above embodiment.
【0033】この図3においては、前記図2の前記受信
タスクTR1〜TRn や前記中継タスクTTや前記送信
タスクTS1〜TSn に相当する合計4個のタスクA〜
Dが便宜上示されている。これら合計4個のタスクA〜
D(タスク40)は、それぞれ、TCB(task control
block)40a と、タスク本体40b とを有している。
又、実行タスクポインタ42は、実行中のタスクの前記
TCB40a 等の位置を示している。In FIG. 3, a total of four tasks A to A corresponding to the reception tasks TR1 to TRn, the relay task TT, and the transmission tasks TS1 to TSn shown in FIG.
D is shown for convenience. These four tasks A in total
D (task 40) is TCB (task control)
block) 40a and task body 40b.
The execution task pointer 42 indicates the position of the TCB 40a or the like of the task being executed.
【0034】この図3においては、前記タスクAが実行
権を放棄すると前記タスクBが前記ラン状態C11とな
り、該タスクBが実行権を放棄すると前記タスクCが前
記ラン状態C11となり、該タスクCが実行権を放棄す
ると前記タスクDが前記ラン状態C11となり、該タス
クDが実行権を放棄すると前記タスクAが前記ラン状態
C11となる。これらタスクA〜Dの実行権の推移の順
序は予め決められたものであり、本実施例では固定され
ている。In FIG. 3, when the task A relinquishes the execution right, the task B enters the run state C11, and when the task B relinquishes the execution right, the task C enters the run state C11. When the task D abandons the execution right, the task D enters the run state C11, and when the task D abandons the execution right, the task A enters the run state C11. The order of transition of the execution rights of these tasks A to D is predetermined, and is fixed in this embodiment.
【0035】前記送受信バッファ36のエリアの有効利
用の観点から、本実施例では、受信バッファ及び送信バ
ッファが共用されている。このように、複数のタスクが
前記送受信バッファ36を共用していると、バッファ領
域が全て使用中になってしまうこともある。又、このよ
うな使用中にも拘らず、複数のタスクがバッファの使用
要求を出すこともある。このような場合にバッファが開
放されると、送受信バッファが使用可能になるというイ
ベントが発生し、複数のタスクが前記図6の従来の前記
ウェイト状態C14に遷移する状況が発生する。しかし
ながら、本実施例では、前記ウェイト状態C14に相当
する状態はなく、例えば前述のようにバッファが開放さ
れたことによるイベントが発生されると、該イベント待
ちであったタスクは、その処理の冒頭で前記使用可能バ
ッファ存在フラグ20e を読み出すことにより、該イベ
ント発生を確認する。From the viewpoint of effective use of the area of the transmission / reception buffer 36, the reception buffer and the transmission buffer are shared in this embodiment. As described above, when a plurality of tasks share the transmission / reception buffer 36, all the buffer areas may be in use. Also, even during such use, a plurality of tasks may issue a buffer use request. When the buffer is released in such a case, an event occurs that the transmission / reception buffer becomes available, and a situation occurs in which a plurality of tasks transit to the conventional wait state C14 of FIG. However, in the present embodiment, there is no state corresponding to the wait state C14, and for example, when an event occurs due to the release of the buffer as described above, the task waiting for the event causes the task at the beginning of the process to start. The event occurrence is confirmed by reading the available buffer existence flag 20e at.
【0036】例えば、前記図3のタスクCがバッファ開
放のイベント待ちである場合で、該図3の上部に示され
るように、タスクBが実行中に該イベントが発生する
と、タスクBが実行権を放棄しタスクCがラン状態C1
1となると、この時点でバッファ開放のイベント発生が
該タスクCのプログラムにより確認される。なお、もし
タスクCがラン状態C11となったにも拘らず、バッフ
ァが開放されていない場合には、該タスクCは実行権を
放棄し、次回の実行権を得たときに該バッファが使用可
能であることを期待する。従って、バッファ使用可能等
のイベントが発生した場合、該イベントを複数のタスク
が待っていたときには、最初に実行権を与えられたタス
クが該イベントの使用権を獲得する。For example, when the task C of FIG. 3 is waiting for a buffer release event and the event occurs while the task B is executing, as shown in the upper part of FIG. Task C is abandoned and task C is in run state C1
When it becomes 1, the program of the task C confirms the occurrence of the buffer release event at this point. If the buffer is not released even though the task C is in the run state C11, the task C abandons the execution right and the buffer is used when the next execution right is obtained. I hope it is possible. Therefore, when an event such as buffer availability occurs, when a plurality of tasks are waiting for the event, the task to which the execution right is given first acquires the right to use the event.
【0037】図4は、前記実施例のタスク状態の状態遷
移図である。FIG. 4 is a state transition diagram of the task state of the above embodiment.
【0038】この図4に示されるように、本実施例にお
いては前記図6に示されるような、前記ウェイト状態C
14が無くなっている。本実施例では、OSの一部とな
っている前記タスク実行権制御部32は、前記ラン状態
C11と、前記レディ状態C12と、前記アイドル状態
C13との間でのタスクの切換えを行うのみとなってお
り、処理時間が少なくなっている。As shown in FIG. 4, in this embodiment, the wait state C as shown in FIG. 6 is used.
14 is gone. In the present embodiment, the task execution right control unit 32, which is a part of the OS, only switches the task among the run state C11, the ready state C12, and the idle state C13. And processing time is getting shorter.
【0039】図5は、前記実施例のタスク状態の遷移を
示すタイムチャートである。FIG. 5 is a time chart showing transitions of task states in the above embodiment.
【0040】この図5においては、(1)従来のOSの
場合と、(2)本実施例の場合とのそれぞれのタイムチ
ャートが示されており、これらが比較できるようになっ
ている。この図5において、符号〜は、それぞれ次
の通りである。In FIG. 5, there are shown time charts of (1) the case of the conventional OS and (2) the case of the present embodiment, which can be compared with each other. In FIG. 5, the symbols 1 to 5 are as follows.
【0041】:イベント待ちタスクの起床 :タスク切換え :タスク実行 :イベント待ち休眠 :イベント記憶 :イベント確認: Wake up task waiting for event : Switch task : Execute task : Sleep waiting event : Store event : Check event
【0042】この図5に示されるように、従来のOSで
はイベントが発生すると、合計4個のタスクA〜Dを起
床させるために、合計4個の符号の処理が行われる。
これに対して、本実施例では、イベントの発生を記憶す
る符号で示される処理のみであり、処理時間が短くな
っている。又、従来のOSの場合、タスクB〜Dが起床
されたにも拘らず、タスクAにより発生したイベントに
対応する資源が既に占有されてしまっている場合には、
再び休眠するための処理等に比較的処理時間がかかる。
比較して、本実施例では、タスクB〜Dは単にイベント
発生に対応するフラグを読み出すという比較的簡単な処
理であり、処理時間も短くなっている。As shown in FIG. 5, when an event occurs in the conventional OS, a total of four codes are processed in order to wake up a total of four tasks A to D.
On the other hand, in the present embodiment, only the processing indicated by the code for storing the occurrence of the event is performed, and the processing time is shortened. Further, in the case of the conventional OS, when the resources corresponding to the event generated by the task A are already occupied even though the tasks B to D are woken up,
It takes a relatively long time to perform processing such as sleeping again.
In comparison, in the present embodiment, tasks B to D are relatively simple processes of simply reading the flag corresponding to the event occurrence, and the processing time is also short.
【0043】[0043]
【発明の効果】以上説明した通り、本発明によれば、イ
ベント発生等に伴って、ラン状態となるタスクを切換
え、マルチタスキングを実現したプロセッサ装置におい
て、個々のタスク実行に要する時間が短く、該時間に比
べて前記イベント発生時等でのOSの処理時間が無視で
きなくなるような場合でも、当該プロセッサ装置全体で
の処理効率を向上することができるという優れた効果を
得ることができる。As described above, according to the present invention, the time required to execute each task is shortened in the processor device which realizes multi-tasking by switching the tasks in the run state in accordance with the occurrence of an event. Even when the processing time of the OS at the time of occurrence of the event cannot be ignored compared to the time, it is possible to obtain an excellent effect that the processing efficiency of the entire processor device can be improved.
【図1】本発明の要旨を示すブロック図FIG. 1 is a block diagram showing the gist of the present invention.
【図2】本発明の実施例の構成を示すブロック図FIG. 2 is a block diagram showing a configuration of an embodiment of the present invention.
【図3】前記実施例の実行可能状態タスク待ち行列の構
造を示す線図FIG. 3 is a diagram showing the structure of a ready task queue of the above embodiment.
【図4】前記実施例のタスク状態の状態遷移図FIG. 4 is a state transition diagram of task states of the above embodiment
【図5】前記実施例のタスク状態の遷移を示すタイムチ
ャートFIG. 5 is a time chart showing transitions of task states in the above embodiment.
【図6】従来のマルチタスキング機能を有するプロセッ
サ装置の状態遷移図FIG. 6 is a state transition diagram of a conventional processor device having a multitasking function.
10…イベント発生受付手段 14…タスク切換手段 20…イベント発生フラグ 20a …受信要求フラグ 20b …回線異常フラグ 20c …中継依頼フラグ 20d …送信依頼フラグ 20e …使用可能バッファ存在フラグ 30…回線インタフェース 32…タスク実行権制御部 34…バッファ管理部 36…送受信バッファ 40…タスク全体 40a …TCB(task control block) 40b …タスク本体 42…実行タスクポインタ C11〜C15…タスク状態 E1〜En …イベント N1、N2…ネットワーク T…タスク群 T1〜Tm …タスク TR1〜TRn …受信タスク TT…中継タクス TS1〜TSn …送信タスク 10 ... Event occurrence receiving means 14 ... Task switching means 20 ... Event occurrence flag 20a ... Reception request flag 20b ... Line error flag 20c ... Relay request flag 20d ... Transmission request flag 20e ... Available buffer existence flag 30 ... Line interface 32 ... Task Execution right control unit 34 ... Buffer management unit 36 ... Transmission / reception buffer 40 ... Whole task 40a ... TCB (task control block) 40b ... Task body 42 ... Execution task pointer C11 to C15 ... Task state E1 to En ... Event N1, N2 ... Network T ... Task group T1 to Tm ... Tasks TR1 to TRn ... Reception task TT ... Relay task TS1 to TSn ... Transmission task
Claims (1)
タスクを切換え、マルチタスキングを実現したプロセッ
サ装置において、 各タスクがイベント発生の有無を読出し可能なイベント
発生フラグを有する記憶手段と、 イベント発生時には、これに対応する前記イベント発生
フラグをセットするイベント発生受付手段と、 前記複数のタスクを、それぞれのタスクの実行権放棄の
毎に、予め定められた順序で順次ラン状態に切り換える
タスク切換手段とを備え、 各タスクでの前記イベントに対応する処理は、それぞれ
のタスクで前記イベント発生フラグを確認しながら実行
することを特徴とするプロセッサ装置。1. In a processor device that implements multitasking by switching tasks that are in a run state in accordance with the occurrence of an event, etc., each task has a storage means having an event occurrence flag capable of reading the presence or absence of an event occurrence. When an event occurs, an event occurrence receiving unit that sets the event occurrence flag corresponding to the event, and a task that sequentially switches the plurality of tasks to a run state in a predetermined order each time the execution right of each task is abandoned. A processor device comprising: a switching unit, wherein processing corresponding to the event in each task is executed while checking the event occurrence flag in each task.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP14935592A JPH05342019A (en) | 1992-06-09 | 1992-06-09 | Processor device |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP14935592A JPH05342019A (en) | 1992-06-09 | 1992-06-09 | Processor device |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| JPH05342019A true JPH05342019A (en) | 1993-12-24 |
Family
ID=15473321
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP14935592A Pending JPH05342019A (en) | 1992-06-09 | 1992-06-09 | Processor device |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JPH05342019A (en) |
-
1992
- 1992-06-09 JP JP14935592A patent/JPH05342019A/en active Pending
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| EP0543512B1 (en) | Multiprocessor system | |
| CA2245963C (en) | Distributed kernel operating system | |
| US20090271796A1 (en) | Information processing system and task execution control method | |
| US6629124B1 (en) | Multimedia data transferring method | |
| US7640549B2 (en) | System and method for efficiently exchanging data among processes | |
| JPH06309252A (en) | Interconnection interface | |
| JPH07101407B2 (en) | Method and apparatus for scheduling | |
| JPH04236647A (en) | Computer system-complex and operating method thereof | |
| JPH0766335B2 (en) | Data communication method | |
| US5592673A (en) | Loosely coupled compound computer system using lock and semaphore mechanism for performing exclusive control of shared resource which is accessed through a distinct bus | |
| JPH01142964A (en) | Memory management | |
| JPH117434A (en) | System for processing quick arrival message in ansyncronous data communication system for plural nodes | |
| CN112506676A (en) | Inter-process data transmission method, computer device and storage medium | |
| JPH05342019A (en) | Processor device | |
| EP0578496B1 (en) | Job execution method in multi-CPU system | |
| US7320044B1 (en) | System, method, and computer program product for interrupt scheduling in processing communication | |
| KR20000064491A (en) | Task Scheduling for Command Handlers | |
| JPH0666061B2 (en) | Multi CPU communication device | |
| US6704765B1 (en) | System for allocating resources among agent processes | |
| JPH09330302A (en) | Performance monitoring method and system for computer system | |
| EP1936514A1 (en) | Operation processing device | |
| JPH09269936A (en) | Remote reading processing method and device therefor | |
| CN121996378A (en) | An interrupt handling method, system, and electronic device | |
| JP2000267960A (en) | Packet communication method and packet communication device between processes | |
| JPH04274524A (en) | System for controlling inter-process communication |