JPH11306033A - Program control method, data processor and storage medium - Google Patents

Program control method, data processor and storage medium

Info

Publication number
JPH11306033A
JPH11306033A JP11724698A JP11724698A JPH11306033A JP H11306033 A JPH11306033 A JP H11306033A JP 11724698 A JP11724698 A JP 11724698A JP 11724698 A JP11724698 A JP 11724698A JP H11306033 A JPH11306033 A JP H11306033A
Authority
JP
Japan
Prior art keywords
task
timer
tsk1
state
data processing
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
JP11724698A
Other languages
Japanese (ja)
Inventor
Masaharu Nagata
雅治 永田
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.)
Fujitsu Ltd
Original Assignee
Fujitsu 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 Fujitsu Ltd filed Critical Fujitsu Ltd
Priority to JP11724698A priority Critical patent/JPH11306033A/en
Priority to PCT/JP1999/001656 priority patent/WO1999056208A1/en
Publication of JPH11306033A publication Critical patent/JPH11306033A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/48Program initiating; Program switching, e.g. by interrupt
    • G06F9/4806Task transfer initiation or dispatching
    • G06F9/4843Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
    • G06F9/4881Scheduling strategies for dispatcher, e.g. round robin, multi-level priority queues

Abstract

PROBLEM TO BE SOLVED: To execute plural tasks in time division by executing the 1st and 2nd tasks in time division and controlling the stop timing via the 1st task itself. SOLUTION: A dormant timer of a timer part is started by a signal outlet function, and a system call is issued by the signal outlet function to set a 1st task TSK1 in a dormant state. Thus, the processing of the TSK1 that is being executed by an execution part 21-1 is discontinued and instead a 2nd task TSK2 kept in a dormant state is operated. When the time-out of the dormant timer is detected, the timer outlet function is called to issue a system call and to return the TSK1 of a dormant state to an operating state. Thus, the TSK1 is returned to its operating state from its dormant state and then returned from the signal outlet function. As a result, true part 21-1 restarts execution of the processing of the TSK1 and the TSK2 of lower priority is returned to its dormant state from its operating state.

Description

【発明の詳細な説明】DETAILED DESCRIPTION OF THE INVENTION

【0001】[0001]

【発明の属する技術分野】本発明は、プログラム制御方
法、データ処理装置及び記憶媒体に係り、特に複数のタ
スクを時分割的に実行するためのプログラム制御方法、
このようなプログラム制御方法を用いたデータ処理装
置、及びデータ処理装置にこのようなプログラム制御を
行わせるプログラムを格納したコンピュータ読み取り可
能な記憶媒体に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a program control method, a data processing device and a storage medium, and more particularly to a program control method for executing a plurality of tasks in a time-sharing manner.
The present invention relates to a data processing device using such a program control method, and a computer-readable storage medium storing a program for causing the data processing device to perform such a program control.

【0002】[0002]

【従来の技術】近年、LAN等のネットワークを介して
コンピュータ等のデータ処理装置間で情報の送受信を行
うことが頻繁に行われている。通常、1つのLANに接
続された複数のデータ処理装置からなるネットワークシ
ステムを設計する際には、1つの通信手順(プロトコ
ル)をサポートするように設計される。しかし、ネット
ワークシステムに新たに追加される装置が他のプロトコ
ルしかサポートしなかったり、ネットワークシステムの
LANがゲートウェイ等を介して他のプロトコルをサポ
ートする他のLANに接続されるような場合には、複数
のプロトコルをサポートする必要がある。
2. Description of the Related Art In recent years, information has been frequently transmitted and received between data processing apparatuses such as computers via a network such as a LAN. Usually, when designing a network system composed of a plurality of data processing devices connected to one LAN, it is designed to support one communication procedure (protocol). However, when a device newly added to the network system only supports another protocol, or when the LAN of the network system is connected to another LAN supporting another protocol via a gateway or the like, Need to support multiple protocols.

【0003】プリンタ装置等のデータ処理装置には、プ
ロトコルに従った情報の送受信を行うためのプロトコル
制御部が設けられている。このようなプリンタ装置がサ
ポートするプロトコルが1つの場合は問題は生じない
が、複数のプロトコルをサポートする場合には、これら
のプロトコルに対応する複数のプロトコル制御部間で調
停を行う必要が生じる。
A data processor such as a printer is provided with a protocol controller for transmitting and receiving information according to a protocol. No problem occurs when such a printer device supports a single protocol, but when a plurality of protocols are supported, it is necessary to perform arbitration between a plurality of protocol controllers corresponding to these protocols.

【0004】リアルタイムオペレーティングシステムに
より例えば夫々異なるプロトコルに対応した複数のタス
クを同時に実行可能なシステムの場合は、それら複数の
プロトコル制御部を並行に動作させることができる。し
かし、一般のオペレーティングシステム(モニタ)で
は、複数のタスクを同時に実行する機能はサポートされ
ていない。このため、複数のタスクを同時に実行する機
能をサポートしないオペレーティングシステムでは、タ
スクに優先順位を付けて、優先順位に従ってタスクを実
行する等の対策を取る必要があった。ところがこの場
合、優先順位の高いタスクが実行され続けると、優先順
位の低いタスクは実行できなくなってしまい、リアルタ
イム処理に適さないという点で問題があった。
In the case of a system capable of simultaneously executing a plurality of tasks respectively corresponding to different protocols by a real-time operating system, the plurality of protocol controllers can be operated in parallel. However, a general operating system (monitor) does not support a function of executing a plurality of tasks simultaneously. Therefore, in an operating system that does not support the function of executing a plurality of tasks at the same time, it is necessary to take measures such as assigning priorities to the tasks and executing the tasks in accordance with the priorities. However, in this case, if a high-priority task continues to be executed, a low-priority task cannot be executed, which is not suitable for real-time processing.

【0005】図1は、プリンタ装置が第1のタスクと第
2のタスクをサポートする場合にリアルタイム処理を可
能とする従来のプログラム制御方法を説明する図であ
る。オペレーティングシステムは、同図(c)に示すタ
イミングでタスクの切り替えを指示する。これにより、
第1のタスクは同図(a)のハイレベル(H)期間のみ
実行され、第2のタスクは同図(b)のハイレベル
(H)期間のみ実行される。この結果、第1のタスク及
び第2のタスクは、時分割的に実行される。ローレベル
(L)期間では、タスクは実行されない。
FIG. 1 is a diagram for explaining a conventional program control method that enables real-time processing when a printer device supports a first task and a second task. The operating system instructs task switching at the timing shown in FIG. This allows
The first task is executed only during the high level (H) period in FIG. 9A, and the second task is executed only during the high level (H) period in FIG. As a result, the first task and the second task are executed in a time-division manner. No tasks are executed during the low level (L) period.

【0006】[0006]

【発明が解決しようとする課題】ところが、従来のプロ
グラム制御方法では、オペレーティングシステムでタス
クの切り替えタイミングを制御しているため、第1のタ
スク及び第2のタスクの間で優先順位を付けることがで
きないという問題があった。又、タスクの切り替えタイ
ミングはオペレーティングシステムで制御しているた
め、実質的に固定であり、第1のタスク及び第2のタス
クに重み付けを付すことは、オペレーティングシステム
自体を変更しない限り不可能であるという問題もあっ
た。
However, in the conventional program control method, since the switching timing of the tasks is controlled by the operating system, it is possible to assign a priority between the first task and the second task. There was a problem that it was not possible. Further, since the task switching timing is controlled by the operating system, it is substantially fixed, and it is impossible to weight the first task and the second task unless the operating system itself is changed. There was also a problem.

【0007】更に、タスクの切り替えタイミングはオペ
レーティングシステムで制御しているため、例えば装置
でサポートするプロトコルの数を増加させる等によりタ
スクの数を3以上等と更に増加させようとすると、実行
時間を均等に振り分ける以外の制御は非常に複雑とな
り、オペレーティングシステム自体の変更が必要となる
ため、現実的ではないという問題もあった。
Further, since the task switching timing is controlled by the operating system, if the number of tasks is further increased to three or more, for example, by increasing the number of protocols supported by the device, the execution time is reduced. The control other than the equal distribution is very complicated, and the operating system itself needs to be changed, which is not realistic.

【0008】そこで、本発明は、オペレーティングシス
テムの変更を行うことなく、複数のタスクに優先順位を
付けて複数のタスクを任意のタイミングで切り替えるこ
とにより、複数のタスクを時分割的に実行可能とするプ
ログラム制御方法、データ処理装置及び記憶媒体を提供
することを目的とする。
Accordingly, the present invention provides a method for executing a plurality of tasks in a time-division manner by prioritizing the plurality of tasks and switching the plurality of tasks at an arbitrary timing without changing the operating system. It is an object of the present invention to provide a program control method, a data processing device, and a storage medium that perform a program.

【0009】[0009]

【課題を解決するための手段】上記の課題は、第1のタ
スクと、前記第1のタスクより優先順位の低い第2のタ
スクとをオペレーティングシステムの制御下で実行する
プログラム制御方法であって、前記オペレーティングシ
ステムの制御下で、前記第1のタスクの実行中は前記第
2のタスクを停止状態に制御し、前記第1のタスクの停
止中は前記第2のタスクを実行させることにより、前記
第1のタスク及び前記第2のタスクを時分割的に実行さ
せるステップと、前記第1のタスクが自身の停止タイミ
ングを制御する制御ステップとを含むプログラム制御方
法により達成される。この場合、オペレーティングシス
テムの変更を行うことなく、複数のタスクに優先順位を
付けて複数のタスクを任意のタイミングで切り替えるこ
とにより、複数のタスクを時分割的に実行可能となる。
An object of the present invention is to provide a program control method for executing a first task and a second task having a lower priority than the first task under the control of an operating system. Controlling the second task to a halt state during execution of the first task under the control of the operating system, and causing the second task to execute during halt of the first task, This is achieved by a program control method including a step of executing the first task and the second task in a time-division manner, and a control step of controlling the stop timing of the first task. In this case, a plurality of tasks can be executed in a time-sharing manner by prioritizing the plurality of tasks and switching the plurality of tasks at an arbitrary timing without changing the operating system.

【0010】前記制御ステップは、タイマを設定し、前
記タイマにより前記第1のタスクに定期的にシグナル送
信を行い、前記シグナル送信に応答して前記第1のタス
クを停止状態に制御し、前記第1のタスクのタイマ出口
関数に基づいて停止中の前記第1のタスクを動作状態に
戻しても良い。前記タイマによる前記第1のタスクの定
期的なシグナル送信の間隔は、前記第1のタスクが連続
的に停止状態にある時間より長く設定されていても良
い。
In the controlling step, a timer is set, a signal is periodically transmitted to the first task by the timer, and the first task is controlled to a stop state in response to the signal transmission. The stopped first task may be returned to the operating state based on the timer exit function of the first task. The interval of the periodic signal transmission of the first task by the timer may be set longer than the time during which the first task is continuously stopped.

【0011】前記タイマ及び前記出口関数は可変設定さ
れても良い。前記第1のタスクは、前記第2のタスクを
含む複数のタスクのうち最も優先順位が高く設定されて
いても良い。上記の課題は、第1のタスクと、前記第1
のタスクより優先順位の低い第2のタスクとをオペレー
ティングシステムの制御下で実行するプロセッサと、前
記オペレーティングシステムの制御下で、前記第1のタ
スクの実行中は前記第2のタスクを停止状態に制御し、
前記第1のタスクの停止中は前記第2のタスクを実行さ
せることにより、前記プロセッサに前記第1のタスク及
び前記第2のタスクを時分割的に実行させる手段と、前
記第1のタスクが自身の停止タイミングを制御する制御
手段とを備えたデータ処理装置によっても達成される。
この場合、オペレーティングシステムの変更を行うこと
なく、複数のタスクに優先順位を付けて複数のタスクを
任意のタイミングで切り替えることにより、複数のタス
クを時分割的に実行可能となる。
[0011] The timer and the exit function may be variably set. The first task may have the highest priority among a plurality of tasks including the second task. The above-mentioned task includes a first task and the first task.
A processor that executes a second task having a lower priority than that of the second task under the control of the operating system; Control and
Means for causing the processor to execute the first task and the second task in a time-division manner by causing the processor to execute the second task while the first task is stopped; This is also achieved by a data processing device provided with a control means for controlling its own stop timing.
In this case, a plurality of tasks can be executed in a time-sharing manner by prioritizing the plurality of tasks and switching the plurality of tasks at an arbitrary timing without changing the operating system.

【0012】前記制御手段は、タイマを設定する手段
と、前記タイマにより前記第1のタスクに定期的にシグ
ナル送信を行う手段と、前記シグナル送信に応答して前
記第1のタスクを停止状態に制御する手段と、前記第1
のタスクのタイマ出口関数に基づいて停止中の前記第1
のタスクを動作状態に戻す手段とからなる構成でも良
い。
The control means includes means for setting a timer, means for periodically transmitting a signal to the first task by the timer, and suspending the first task in response to the signal transmission. Means for controlling;
Said first stopped based on the timer exit function of the task
And means for returning the task to the operating state.

【0013】前記タイマによる前記第1のタスクの定期
的なシグナル送信の間隔は、前記第1のタスクが連続的
に停止状態にある時間より長く設定されていても良い。
前記タイマ及び前記出口関数は可変設定されても良い。
前記第1のタスクは、前記第2のタスクを含む複数のタ
スクのうち最も優先順位が高く設定されていても良い。
[0013] The interval of the periodic signal transmission of the first task by the timer may be set longer than the time during which the first task is continuously stopped.
The timer and the exit function may be variably set.
The first task may have the highest priority among a plurality of tasks including the second task.

【0014】データ処理装置は、第1のプロトコル及び
前記第1のプロトコルとは異なる第2のプロトコルに従
った要求をネットワークを介して受信すると共に前記ネ
ットワークを介した情報の送受信を制御するネットワー
ク部を更に備え、前記第1及び第2のタスクは夫々該第
1及び第2のプロトコルに対応しても良い。データ処理
装置は、前記第1及び第2のタスクに基づいて情報を出
力する出力装置を更に備えても良い。
[0014] A data processing apparatus receives a request according to a first protocol and a second protocol different from the first protocol via a network and controls transmission and reception of information via the network. And the first and second tasks may correspond to the first and second protocols, respectively. The data processing device may further include an output device that outputs information based on the first and second tasks.

【0015】上記の課題は、オペレーティングシステム
の制御下で、第1のタスクの実行中は前記第1のタスク
より優先順位の低い第2のタスクを停止状態に制御し、
前記第1のタスクの停止中は前記第2のタスクを実行さ
せることにより、前記第1のタスク及び前記第2のタス
クを時分割的に実行させるデータ処理装置を制御するプ
ログラムを格納したコンピュータ読み取り可能な記憶媒
体であって、前記データ処理装置を前記第1のタスクが
自身の停止タイミングを制御する制御手段として機能さ
せるためのプログラムを格納した記憶媒体によっても達
成される。この場合、オペレーティングシステムの変更
を行うことなく、複数のタスクに優先順位を付けて複数
のタスクを任意のタイミングで切り替えることにより、
複数のタスクを時分割的に実行可能となる。
[0015] The object of the present invention is to control a second task having a lower priority than the first task to a stopped state during execution of the first task under the control of the operating system.
While the first task is stopped, the second task is executed, whereby a computer-readable program storing a program for controlling a data processing device that executes the first task and the second task in a time-division manner is stored. A possible storage medium is also achieved by a storage medium storing a program for causing the data processing device to function as control means for controlling the stop timing of the first task. In this case, by prioritizing multiple tasks and switching between them at any time without changing the operating system,
A plurality of tasks can be executed in a time-sharing manner.

【0016】前記制御手段は、前記データ処理装置に、
タイマを設定させ、前記タイマにより前記第1のタスク
に定期的にシグナル送信を行わせ、前記シグナル送信に
応答して前記第1のタスクを停止状態に制御させ、前記
第1のタスクのタイマ出口関数に基づいて停止中の前記
第1のタスクを動作状態に戻させても良い。前記タイマ
による前記第1のタスクの定期的なシグナル送信の間隔
は、前記第1のタスクが連続的に停止状態にある時間よ
り長く設定されていても良い。
[0016] The control means includes:
Setting a timer, causing the first task to periodically transmit a signal using the timer, controlling the first task to stop in response to the signal transmission, and setting a timer exit of the first task The stopped first task may be returned to an operating state based on a function. The interval of the periodic signal transmission of the first task by the timer may be set longer than the time during which the first task is continuously stopped.

【0017】前記タイマ及び前記出口関数は可変設定さ
れても良い。前記第1のタスクは、前記第2のタスクを
含む複数のタスクのうち最も優先順位が高く設定されて
いても良い。
[0017] The timer and the exit function may be variably set. The first task may have the highest priority among a plurality of tasks including the second task.

【0018】[0018]

【発明の実施の形態】本発明の動作原理を図2と共に説
明する。図2は、第1のプロトコルに対応する第1のタ
スクと、第2のプロトコルに対応すると共に前記第1の
タスクより優先順位の低い第2のタスクとの実行タイミ
ングを示す図である。第1及び第2のプロトコルをオペ
レーティングシステム(モニタ)の制御下で実行する際
に、第1のタスクの実行中は第2のタスクを停止(以
下、休止とする)状態に制御し、第1のタスクの停止
(以後、休眠とする)中は第2のタスクを実行させるこ
とにより、第1のタスク及び第2のタスクを時分割的に
実行させる。本発明では、第1のタスクが自身の休眠タ
イミングを制御する。
DESCRIPTION OF THE PREFERRED EMBODIMENTS The principle of operation of the present invention will be described with reference to FIG. FIG. 2 is a diagram illustrating execution timings of a first task corresponding to the first protocol and a second task corresponding to the second protocol and having a lower priority than the first task. When the first and second protocols are executed under the control of the operating system (monitor), the second task is controlled to be stopped (hereinafter referred to as a pause) while the first task is being executed, While the second task is stopped (hereinafter referred to as sleep), the first task and the second task are executed in a time-division manner by executing the second task. In the present invention, the first task controls its own sleep timing.

【0019】これにより、第1のタスクの休眠タイミン
グは、オペレーティングシステムが直接制御することな
く、第1のタスクにより制御され、第1のタスクの休眠
中は第2のタスクを実行させることができる。従って、
オペレーティングシステムの変更を行うことなく、複数
のタスクに優先順位を付けて複数のタスクを任意のタイ
ミングで切り替えることにより、複数のタスクを時分割
的に実行可能となる。
Thus, the sleep timing of the first task is controlled by the first task without being directly controlled by the operating system, and the second task can be executed during the sleep of the first task. . Therefore,
By prioritizing the tasks and switching the tasks at an arbitrary timing without changing the operating system, the tasks can be executed in a time-sharing manner.

【0020】尚、第2のタスクは、第1のタスク以外の
タスクであれば、第2のプロトコルに対応している必要
はないことは言うまでもない。
It is needless to say that the second task does not need to correspond to the second protocol as long as it is a task other than the first task.

【0021】[0021]

【実施例】図3は、本発明になるプログラム制御方法、
データ処理装置及び記憶媒体を適用可能なネットワーク
システムを示す図である。同図中、第1のLANには、
パーソナルコンピュータ等の複数のコンピュータ2−1
〜2−3と、複数のプリンタ装置3−1,3−2とが接
続されている。プリンタ装置3−1,3−2は、出力装
置として設けられており、プリンタ装置3−1はLAN
アダプタ3−1aを介して第1のLAN1に接続され、
プリンタ装置3−2はコンピュータ2−2を介して第1
のLAN1に接続されている。又、第1のLAN1は、
ゲートウェイ4を介して第2のLAN5に接続されてい
る。
FIG. 3 shows a program control method according to the present invention;
FIG. 1 is a diagram illustrating a network system to which a data processing device and a storage medium can be applied. In the figure, the first LAN has
Multiple computers 2-1 such as personal computers
2-3 and a plurality of printer devices 3-1 and 3-2 are connected. The printers 3-1 and 3-2 are provided as output devices, and the printer 3-1 is connected to a LAN.
Connected to the first LAN 1 via the adapter 3-1a,
The printer device 3-2 is connected to the first device via the computer 2-2.
LAN1. Also, the first LAN 1
It is connected to a second LAN 5 via a gateway 4.

【0022】このようなネットワークシステムでは、同
じ第1のLAN1に接続されたコンピュータ2−1〜2
−3間で情報のやり取りを行ったり、コンピュータ2−
1〜2−3と第2のLANに接続されたコンピュータ等
(図示せず)とゲートウェイ4を介して情報のやり取り
を行うことができる。プリンタ装置3−1の場合、第1
のLAN1に接続されたコンピュータ2−1〜2−3か
らの情報を受信して印刷したり、第2のLANに接続さ
れたコンピュータ等からの情報をゲートウェイ4及び第
1のLAN1を介して受信して印刷したりすることがで
きる。又、プリンタ装置3−2の場合、第1のLAN1
に接続されたコンピュータ2−1,2−3や第2のLA
Nに接続されたコンピュータ等からの情報をゲートウェ
イ4、第1のLAN1及びコンピュータ3−2を介して
受信して印刷したり、コンピュータ3−2からの情報を
直接受信して印刷したりすることができる。
In such a network system, the computers 2-1 to 2-2 connected to the same first LAN 1
-3, exchange information between computers,
Information can be exchanged via the gateway 4 with computers 1-2 (not shown) connected to 1-2 and the second LAN. In the case of the printer device 3-1, the first
Receives and prints information from the computers 2-1 to 2-3 connected to the first LAN 1 and receives information from a computer or the like connected to the second LAN via the gateway 4 and the first LAN 1. And print it out. In the case of the printer device 3-2, the first LAN 1
2-1 and 2-3 and the second LA connected to the
Receiving and printing information from a computer or the like connected to N via the gateway 4, the first LAN 1 and the computer 3-2, or receiving and printing information from the computer 3-2 directly Can be.

【0023】図4は、プリンタ装置の一実施例を示すブ
ロック図である。説明の便宜上、同図はプリンタ装置3
−1を示すものとする。プリンタ装置3−1は、本発明
になるデータ処理装置の一実施例を構成し、本発明にな
るプログラム制御方法の一実施例を採用する。プリンタ
装置3−1は、同図に示すように、バス17に接続され
たCPU11、メモリ12、ROM13、タイマ部1
4、LAN制御部15及び印刷部16からなる。
FIG. 4 is a block diagram showing an embodiment of the printer device. For convenience of explanation, FIG.
-1. The printer 3-1 constitutes one embodiment of the data processing device according to the present invention, and employs one embodiment of the program control method according to the present invention. As shown in FIG. 1, the printer device 3-1 includes a CPU 11, a memory 12, a ROM 13, and a timer unit 1 connected to a bus 17.
4. It comprises a LAN control unit 15 and a printing unit 16.

【0024】CPU11は、プリンタ装置3−1全体の
動作を制御するために設けられている。メモリ12は、
CPU11が実行するプログラムやCPU11が実行す
る演算の中間データや、印刷部16により印刷するため
の受信データを展開したデータ等を格納するために設け
られており、メモリ12に格納されるプログラムは任意
の時点でインストール可能である。ROM13は、ブー
トアップ用プログラムを含むCPU11が実行するプロ
グラム等を予め格納している。タイマ部14は、CPU
11内の内部タイマ(例えば、オペレーティングシステ
ムのタイマ)で生成するタイミング以外の、信号のやり
取りのタイミングを生成するために設けられている。L
AN制御部15は、第1のLAN1を介して情報の送受
信を行うために必要な制御をCPU11の制御下で行う
もので、本実施例では便宜上LANアダプタ3−1aを
内蔵しているものとする。印刷部16は、周知のプリン
タエンジン及び周知の印刷機構からなり、CPU11の
制御下で情報の紙等の記録媒体に印刷する。
The CPU 11 is provided for controlling the operation of the entire printer device 3-1. The memory 12
The program is provided to store a program executed by the CPU 11, intermediate data of an operation executed by the CPU 11, data obtained by expanding received data to be printed by the printing unit 16, and the like. The program stored in the memory 12 is arbitrary. It can be installed at the time. The ROM 13 stores in advance programs and the like executed by the CPU 11 including a boot-up program. The timer unit 14 has a CPU
It is provided to generate a signal exchange timing other than a timing generated by an internal timer (for example, a timer of an operating system) in the communication device 11. L
The AN control unit 15 performs control necessary for transmitting and receiving information via the first LAN 1 under the control of the CPU 11. In this embodiment, the AN control unit 15 includes a LAN adapter 3-1a for convenience. I do. The printing unit 16 includes a well-known printer engine and a well-known printing mechanism, and prints information on a recording medium such as paper under the control of the CPU 11.

【0025】尚、プリンタ装置3−2の場合は、LAN
制御部15にはLANアダプタ3−1aが設けられず、
第1のLAN1に直接接続する代わりに、コンピュータ
2−2を介して第1のLAN1に接続される。又、コン
ピュータ2−1〜2−3もプリンタ装置3−1,3−2
と同様にデータ処理装置であるから、基本構成は図4に
示すプリンタ装置3−1と同じであるが、コンピュータ
2−1〜2−3の場合は印刷部16が設けられていな
い。
In the case of the printer 3-2, the LAN
The control unit 15 is not provided with the LAN adapter 3-1a,
Instead of being directly connected to the first LAN 1, it is connected to the first LAN 1 via the computer 2-2. The computers 2-1 to 2-3 are also printer devices 3-1 and 3-2.
The basic configuration is the same as that of the printer device 3-1 shown in FIG. 4 except that the printing unit 16 is not provided in the case of the computers 2-1 to 2-3.

【0026】上記コンピュータ2−1〜2−3及びプリ
ンタ装置3−1,3−2は、上記の如き構成に限定され
るものではなく、各種周知の構成のコンピュータ及びプ
リンタ装置を用いても良いことは言うまでもない。本実
施例では、第1のLAN1に接続されている各データ処
理装置が、複数の異なるプロトコルをサポートしてい
る。説明の便宜上、以下の説明では、第1のLAN1に
接続されている各データ処理装置が第1のプロトコル
と、第1のプロトコルとは異なる第2のプロトコルとを
サポートしており、データ処理装置がプリンタ装置3−
1の場合の動作を例に取って説明する。第1のプロトコ
ルは、例えばIPX/SPX(例えば、Novell社
の製品Netwareで知られる)であり、第2のプロ
トコルは例えばTCP/IPである。又、本実施例で
は、後述するように、第1のプロトコルの優先順位が、
第2のプロトコルより高く設定されているものとする。
The above-mentioned computers 2-1 to 2-3 and the printers 3-1 and 3-2 are not limited to the above-described configurations, but may use computers and printers of various well-known configurations. Needless to say. In this embodiment, each data processing device connected to the first LAN 1 supports a plurality of different protocols. For convenience of explanation, in the following description, each data processing device connected to the first LAN 1 supports a first protocol and a second protocol different from the first protocol. Is the printer device 3-
The operation in the case of 1 will be described as an example. The first protocol is, for example, IPX / SPX (for example, known in the product Network of Novell), and the second protocol is, for example, TCP / IP. In this embodiment, as described later, the priority of the first protocol is
It is assumed that it is set higher than the second protocol.

【0027】本実施例で使用するオペレーティングシス
テムでは、同時に1つのタスクしか実行できない。つま
り、オペレーティングシステムの制御下で、CPU11
は第1のプロトコルに対応する第1のタスクTSK1を
実行するか、第2のプロトコルに対応する第2のタスク
TSK2を実行する。第1のタスクTSK1の実行中
は、第2のタスクTSK2を実行することはできず、第
2のタスクTSK2の実行中は、第1のタスクTSK1
を実行することはできない。
The operating system used in this embodiment can execute only one task at a time. That is, under the control of the operating system, the CPU 11
Executes the first task TSK1 corresponding to the first protocol, or executes the second task TSK2 corresponding to the second protocol. During the execution of the first task TSK1, the second task TSK2 cannot be executed. During the execution of the second task TSK2, the first task TSK1 is not executed.
Can not be performed.

【0028】尚、第2のタスクTSK2は、第1のタス
クTSK1以外のタスクであれば、第2のプロトコルに
対応している必要はないことは言うまでもない。図5に
示すように、第1のタスクTSK1は実行部21−1と
割り込み部22−1とからなり、第2のタスクTSK2
は実行部21−2と割り込み部22−2とからなる。実
行部21−1,21−2は、夫々タスクに対応する処理
を実行し、割り込み部22−1,22−2は、夫々割り
込み処理を実行する。割り込みには、ハードウェアから
ソフトウェアへの割り込みと、ソフトウェアからソフト
ウェア又はハードウェアへの割り込みとがある。一般的
には、後者の方、即ち、割り込み部22−1,22−2
を使用したデータのやり取りの方を、シグナル通信と言
う。第1のタスクTSK1から第2のタスクTSK2へ
のシグナル通信は、実行部21−1又は割り込み部22
−1から割り込み部22−2に対して行われ、第2のタ
スクTSK2から第1のタスクTSK1へのシグナル通
信は、実行部21−2又は割り込み部22−2から割り
込み部22−1に対して行われる。つまり、シグナル通
信を受ける側は、必ず割り込み部22−1又は22−2
である。本実施例では、オペレーティングシステムによ
るタイミング制御ではなく、このシグナル通信機能を利
用して第1のタスクTSK1と第2のタスクTSK2と
の切り替えを制御する。
It goes without saying that the second task TSK2 does not need to support the second protocol as long as it is a task other than the first task TSK1. As shown in FIG. 5, the first task TSK1 includes an execution unit 21-1 and an interrupt unit 22-1, and the second task TSK2
Comprises an execution unit 21-2 and an interruption unit 22-2. The execution units 21-1 and 21-2 execute processes corresponding to the tasks, respectively, and the interrupt units 22-1 and 22-2 execute the interrupt processes, respectively. The interrupt includes an interrupt from hardware to software and an interrupt from software to software or hardware. Generally, the latter, that is, the interrupt units 22-1 and 22-2
Data exchange using is called signal communication. Signal communication from the first task TSK1 to the second task TSK2 is performed by the execution unit 21-1 or the interrupt unit 22.
-1 to the interrupt unit 22-2, and the signal communication from the second task TSK2 to the first task TSK1 is performed by the execution unit 21-2 or the interrupt unit 22-2 to the interrupt unit 22-1. Done. That is, the side receiving the signal communication must be the interrupt unit 22-1 or 22-2.
It is. In the present embodiment, the switching between the first task TSK1 and the second task TSK2 is controlled using this signal communication function instead of the timing control by the operating system.

【0029】図6は、本実施例におけるタスクの切り替
えを説明する図である。同図中、オペレーティングシス
テムの指示に基づきタスクを生成するためのプログラム
である第1のプロトコル初期化ルーチン31が開始され
ると、シグナル出口関数が登録されると共に、タイマ部
14のタイマが設定されて起動される。「出口関数」と
は、ある事象の変化に対応する処理を行うためのプログ
ラムである。第1のプロトコル初期化ルーチン31は、
要求元からの印刷要求等の第1のプロトコルに従った要
求に応答して開始される。ステップ32では、タイマか
らの割り込みに応答してシグナル通信を定期的に行う。
このシグナル通信は、第1のタイマ出口関数F1により
第1のタスクTSK1の割り込み部22−1に対して行
われ、割り込み部22−1内のシグナル出口関数を呼び
出す。第1のタイマ出口関数F1は、最初は初期化ルー
チンによって登録され、その後はシグナル出口関数によ
って次のタイマ起動のために「処理続行」の後に登録さ
れる。第1のタイマ出口関数F1は、第1のタスクTS
K1に属する。これにより、ステップ33では、シグナ
ル出口関数によりタイマ部14の休眠時間タイマを起動
し、ステップ34では、シグナル出口関数で第1のタス
クTSK1を休眠状態にするシステムコールを発行す
る。この結果、実行部21−1が実行中の第1のタスク
TSK1の処理は中断され、第1のタスクTSK1は休
眠状態となり、代わりに、休止中の第2のタスクTSK
2が動作状態へ移行する。つまり、第2のタスクTSK
2の実行部21−2が第2のタスクTSK2の処理の実
行を開始する。
FIG. 6 is a diagram for explaining the task switching in this embodiment. In the figure, when a first protocol initialization routine 31 which is a program for generating a task based on an instruction from the operating system is started, a signal exit function is registered and a timer of the timer unit 14 is set. Is started. An “exit function” is a program for performing a process corresponding to a change in a certain event. The first protocol initialization routine 31 includes:
It is started in response to a request according to the first protocol, such as a print request from a request source. In step 32, signal communication is performed periodically in response to an interrupt from the timer.
This signal communication is performed by the first timer exit function F1 to the interrupt unit 22-1 of the first task TSK1, and calls the signal exit function in the interrupt unit 22-1. The first timer exit function F1 is first registered by the initialization routine, and thereafter is registered by the signal exit function after "continue processing" for starting the next timer. The first timer exit function F1 has a first task TS
Belongs to K1. Thus, in step 33, the sleep time timer of the timer unit 14 is started by the signal exit function, and in step 34, a system call for putting the first task TSK1 into the sleep state is issued by the signal exit function. As a result, the processing of the first task TSK1 that is being executed by the execution unit 21-1 is interrupted, the first task TSK1 enters a sleep state, and instead, the second task TSK 1 that is paused is executed.
2 shifts to the operating state. That is, the second task TSK
The second execution unit 21-2 starts executing the processing of the second task TSK2.

【0030】ステップ35で、休眠時間タイマのタイム
アウトが検出されると、ステップ36でタイマ出口関数
が呼び出され、タイマ出口関数で休眠状態の第1のタス
クTSK1を動作状態に戻すシステムコールを発行す
る。ステップ35,36は、第2のタイマ出口関数F2
により行われる。第2のタイマ出口関数F2も、第1の
タイマ出口関数F1と同様に、第1のタスクTSK1に
属する。これにより、第1のタスクTSK1は休眠状態
から動作状態へ復帰し、シグナル出口関数から復帰する
ことにより実行部21−1が第1のタスクTSK1の処
理の実行を再開する。他方、第1のタスクTSK1が動
作状態へ復帰すると、第1のタスクTSK1より優先順
位の低い第2のタスクTSK2は、動作状態から休止状
態へ戻される。このようにして、以下同様に、タイマか
らの割り込みに応答してシグナル通信を定期的に行うこ
とにより、第1タスクTSK1が定期的に休眠状態とな
り、第1のタスクTSK1が休眠状態にある間のみ、第
2のタスクTSK2が休止状態から動作状態に移行し、
結果的に第1のタスクTSK1及び第2のタスクTSK
2が交互に実行される。
When the timeout of the sleep time timer is detected in step 35, the timer exit function is called in step 36, and the timer exit function issues a system call for returning the dormant first task TSK1 to the operating state. . Steps 35 and 36 correspond to the second timer exit function F2
It is performed by The second timer exit function F2 also belongs to the first task TSK1, similarly to the first timer exit function F1. Thereby, the first task TSK1 returns from the sleep state to the operation state, and returns from the signal exit function, so that the execution unit 21-1 resumes the execution of the processing of the first task TSK1. On the other hand, when the first task TSK1 returns to the operation state, the second task TSK2 having a lower priority than the first task TSK1 returns from the operation state to the sleep state. In this manner, similarly, by periodically performing signal communication in response to an interrupt from the timer, the first task TSK1 periodically goes into a sleep state, and the first task TSK1 goes into a sleep state. Only, the second task TSK2 shifts from the sleep state to the operation state,
As a result, the first task TSK1 and the second task TSK
2 are executed alternately.

【0031】尚、第1のタスクTSK1が休眠状態にあ
る間に、休眠時間タイマのタイムアウトが検出される前
に再度にシグナル通信が行われることを防止するため、
シグナル通信間隔は第1のタスクTSK1の休眠時間
(休眠時間タイマのタイムアウト)より長く設定され
る。例えば、シグナル通信間隔が数百ミリ秒であれば、
休眠時間はその1/10程度に設定される。
While the first task TSK1 is in the sleep state, the signal communication is prevented from being performed again before the timeout of the sleep time timer is detected.
The signal communication interval is set longer than the sleep time of the first task TSK1 (timeout of the sleep time timer). For example, if the signal communication interval is several hundred milliseconds,
The sleep time is set to about 1/10 of that.

【0032】本実施例では、タイマ及び休眠時間タイマ
の設定値は可変設定可能である。このため、第1のタス
クTSK1及び第2のタスクTSK2の夫々の実行時間
及び実行時間の比率、即ち、第1タスクTSK1の休眠
タイミング及び休眠時間は、任意に設定可能である。
又、第1のタスクTSK1が自身の休眠のタイミングを
制御しているので、オペレーティングシステム及び第1
及び第2のタスクTSK1,TSK2の実行部22−
1,22−2の変更は不要である。
In this embodiment, the set values of the timer and the sleep time timer can be variably set. For this reason, the execution time and the ratio of the execution time of each of the first task TSK1 and the second task TSK2, that is, the sleep timing and the sleep time of the first task TSK1, can be arbitrarily set.
Also, since the first task TSK1 controls its own sleep timing, the operating system and the first task
And the execution units 22- of the second tasks TSK1 and TSK2
There is no need to change 1,22-2.

【0033】次に、上記シグナル出口関数及びタイマ出
口関数の処理を、図7に示すフローチャートと共に説明
する。例えばコンピュータ2−1が印刷要求元でありプ
リンタ装置3−1に対して例えば第1のプロトコルで印
刷要求を行う場合、第1のタスクTSK1の実行部22
−1が印刷制御処理等を実行中に第1のタスクTSK1
を定期的に、且つ、強制的に休眠状態として第2のタス
クTSK2を実行することにより、第1及び第2のタス
クTSK1,TSK2を交互に実行するので、第1のタ
スクTSK1が休眠中にコンピュータ2−1からの要求
に対する許容時間がタイムアウトしてしまわないよう対
策を取る必要がある。そこで、本実施例では、第1のタ
スクTSK1とシグナル出口関数との間に休眠許可フラ
グを設け、クリチカルな処理を行っている間は第1のタ
スクTSK1が強制的に休眠状態にされないようにす
る。又、第1のタスクTSK1が常に定期的に強制的に
休眠状態にすると、ネットワークシステムへの付加が増
大して性能も低下してしまう。しかし、実行部21−1
内で連続して実行する印刷制御処理等の部分は特定でき
るので、特定された部分を実行中にのみ休眠許可フラグ
を設けて第1のタスクTSK1が休眠状態に入る箇所を
限定することもできる。
Next, the processing of the signal exit function and the timer exit function will be described with reference to the flowchart shown in FIG. For example, when the computer 2-1 is a print request source and makes a print request to the printer device 3-1 using, for example, a first protocol, the execution unit 22 of the first task TSK1
-1 indicates that the first task TSK1 is executing the print control process or the like.
Is periodically and forcibly set to the sleep state to execute the second task TSK2, thereby alternately executing the first and second tasks TSK1 and TSK2, so that the first task TSK1 is in the sleep state. It is necessary to take measures so that the allowable time for the request from the computer 2-1 does not time out. Therefore, in the present embodiment, a sleep permission flag is provided between the first task TSK1 and the signal exit function so that the first task TSK1 is not forcibly put into the sleep state during the critical processing. I do. In addition, if the first task TSK1 is always forced to sleep periodically, the load on the network system increases and the performance decreases. However, the execution unit 21-1
Since the part such as the print control processing to be continuously executed in the part can be specified, a sleep permission flag can be provided only during the execution of the specified part to limit the part where the first task TSK1 enters the sleep state. .

【0034】図7において、第1のタスクTSK1の実
行が開始されると、ステップ41でシグナル出口関数を
登録し、ステップ42でタイマを設定して起動する。ス
テップ41,42は、第1のプロトコル初期化ルーチン
に含まれる。その後、第1のタスクTSK1の処理が行
われ、ステップ43では休眠許可フラグをセットし、ス
テップ44でログイン/再接続処理等が行われ、ステッ
プ45で休眠許可フラグがクリアされる。
In FIG. 7, when the execution of the first task TSK1 is started, a signal exit function is registered in step 41, and a timer is set and activated in step 42. Steps 41 and 42 are included in a first protocol initialization routine. Thereafter, the process of the first task TSK1 is performed, a sleep permission flag is set in step 43, a login / reconnection process or the like is performed in step 44, and the sleep permission flag is cleared in step 45.

【0035】これと並行して、ステップ42でタイマが
起動されると、ステップ51では、割り込み部22−1
内のシグナル出口関数を呼び出す処理が開始され、ステ
ップ52では、タイマからの割り込みに応答してシグナ
ル通信を定期的に行う。このシグナル通信は、第1のタ
スクTSK1の割り込み部22−1に対して行われ、割
り込み部22−1内のシグナル出口関数を呼び出す。こ
れにより、ステップ57では、休眠許可フラグがセット
されているか否かを判定する。ステップ57の判定結果
がNOであれば、処理はステップ65へ進み、第1のタ
スクTSK1の処理を行うステップ44へ復帰する。
In parallel with this, when the timer is started in step 42, in step 51, the interrupt unit 22-1
The process of calling the signal exit function in the communication is started, and in step 52, the signal communication is periodically performed in response to the interruption from the timer. This signal communication is performed with respect to the interrupt unit 22-1 of the first task TSK1, and calls the signal exit function in the interrupt unit 22-1. Thus, in step 57, it is determined whether or not the sleep permission flag is set. If the decision result in the step 57 is NO, the process proceeds to a step 65 and returns to the step 44 for performing the process of the first task TSK1.

【0036】他方、ステップ57の判定結果がYESで
あると、ステップ58は、シグナル出口関数によりタイ
マ14の休眠時間タイマを起動し、ステップ59では、
シグナル出口関数で第1のタスクTSK1を休眠状態に
するシステムコールを発行する。この結果、実行部21
−1が実行中の第1のタスクTSK1の処理は中断さ
れ、第1のタスクTSK1は休眠状態となり、代わり
に、休止中の第2のタスクTSK2が動作状態へ移行す
る。つまり、第2のタスクTSK2の実行部21−2が
第2のタスクTSK2の処理の実行を開始する。
On the other hand, if the decision result in the step 57 is YES, a step 58 activates a sleep time timer of the timer 14 by the signal exit function.
A system call for putting the first task TSK1 into a sleep state is issued by a signal exit function. As a result, the execution unit 21
The processing of the first task TSK1 in which −1 is being executed is interrupted, the first task TSK1 goes into a sleep state, and instead, the second task TSK2 that is in a sleep state shifts to an operation state. That is, the execution unit 21-2 of the second task TSK2 starts executing the processing of the second task TSK2.

【0037】又、ステップ58の後、ステップ61は、
休眠時間タイマのタイムアウトが発生したか否かを判定
し、判定結果がYESとなり休眠時間タイマのタイムア
ウトが検出されると、ステップ62でタイマ出口関数を
呼び出す。又、ステップ64は、タイマ出口関数で休眠
状態の第1のタスクTSK1を動作状態に戻すシステム
コールを発行し、処理は上記ステップ65へ進んで第1
のタスクTSK1の処理を行うステップ44へ復帰す
る。つまり、シグナル出口関数から復帰することによ
り、第1のタスクTSK1は休眠状態から動作状態へ復
帰し、実行部21−1が第1のタスクTSK1の処理の
実行を再開する。
After step 58, step 61 comprises:
It is determined whether or not a timeout of the sleep time timer has occurred. If the determination result is YES and the timeout of the sleep time timer is detected, a timer exit function is called in step 62. In step 64, a system call is issued by the timer exit function to return the dormant first task TSK1 to the operating state.
Then, the process returns to step 44 for performing the process of the task TSK1. That is, by returning from the signal exit function, the first task TSK1 returns from the sleep state to the operation state, and the execution unit 21-1 resumes the execution of the processing of the first task TSK1.

【0038】他方、第1のタスクTSK1が動作状態へ
復帰すると、第1のタスクTSK1より優先順位の低い
第2のタスクTSK2は、動作状態から休止状態へ戻さ
れる。このようにして、以下同様に、第1のタスクTS
K1が定期的に休眠状態となり、第1のタスクTSK1
が休眠状態にある間のみ、第2のタスクTSK2が休止
状態から動作状態に移行する。
On the other hand, when the first task TSK1 returns to the operating state, the second task TSK2 having a lower priority than the first task TSK1 is returned from the operating state to the sleep state. In this way, similarly, the first task TS
K1 periodically goes to sleep, and the first task TSK1
The second task TSK2 shifts from the dormant state to the operating state only while is in the dormant state.

【0039】このように、本実施例では、一般的なオペ
レーティングシステムに備わっている、(i)タスクを
休眠状態に制御する、(ii)タスクに対してシグナル
通信を行う、及び(iii)タイマの設定によりタイマ
出口関数を呼び出すという機能を用いて第1のタスクT
SK1を定期的に休眠状態にして第2のタスクTSK2
との時分割的な実行を可能とする。
As described above, in this embodiment, (i) controlling a task to be in a sleep state, (ii) performing signal communication with the task, and (iii) timer provided in a general operating system. The first task T using the function of calling the timer exit function by setting
SK1 is periodically set to a sleep state, and a second task TSK2 is set.
And time-division execution.

【0040】次に、第1のタスクTSK1の休眠状態中
に第2のタスクTSK2が実行されるメカニズムについ
て、図8及び図9と共に説明する。図8は、オペレーテ
ィングシステムのタスク切り替え処理を説明するフロー
チャートであり、図9は、オペレーティングシステムが
メモリ12等で管理している状態テーブルを説明する図
である。
Next, a mechanism by which the second task TSK2 is executed while the first task TSK1 is in the sleep state will be described with reference to FIGS. FIG. 8 is a flowchart illustrating a task switching process of the operating system, and FIG. 9 is a diagram illustrating a state table managed by the operating system in the memory 12 or the like.

【0041】本実施例では、オペレーティングシステム
は一度に1つのタスクしか実行できない構成であるた
め、1つのタスクを実行中は他のタスクを休止状態に制
御する。このような制御自体は、このようなオペレーテ
ィングシステムでは一般的に行われているものである。
図8において、ステップ71は、実行中のタスクを図9
に示す状態テーブル90から検索する。状態テーブル9
0は、図9に示すように、各タスクの状態及び優先順位
のレベルを管理している。状態テーブル90で管理され
るタスクの状態には、休止/休眠中ではない状態、割り
込み中ではない状態及び必要な資源待ちの状態が含ま
れ、各状態が満足される場合は「1」、満足されない場
合は「0」が設定される。休止/休眠中ではない状態、
割り込み中ではない状態及び必要な資源待ちの状態が全
て「0」であれば、タスクが実行中であるものとする。
又、優先順位のレベルは、数が低い程優先順位が高いも
のとする。尚、図9では、説明の便宜上、第1及び第2
のタスクTSK1,TSK2の2つのタスクのみについ
ての状態及び優先順位のレベルが状態テーブル90によ
り管理されているが、3以上のタスクの状態及び優先順
位のレベルが管理されても良いことは言うまでもない。
In this embodiment, since the operating system is configured to execute only one task at a time, the other tasks are controlled to be in a sleep state while one task is being executed. Such control itself is generally performed in such an operating system.
In FIG. 8, a step 71 is a step of
From the state table 90 shown in FIG. State table 9
0 manages the status of each task and the priority level as shown in FIG. The states of the tasks managed in the state table 90 include a state that is not in sleep / sleep, a state that is not interrupted, and a state of waiting for necessary resources. If each state is satisfied, “1” is satisfied. If not, "0" is set. Not sleeping / dormant,
If the state of not being interrupted and the state of waiting for necessary resources are all “0”, it is assumed that the task is being executed.
In the priority level, the lower the number, the higher the priority. Note that in FIG. 9, the first and second
The state and the priority level of only two tasks TSK1 and TSK2 are managed by the state table 90, but it goes without saying that the states and priority levels of three or more tasks may be managed. .

【0042】ステップ72は、状態テーブル90を用い
て、現在実行中のタスクと他の実行中のタスクとの優先
順位レベルを比較して、現在実行中のタスクより優先順
位レベルが高い実行中のタスクが存在するか否かを判定
する。ステップ72の判定結果がNOであると、処理は
後述するステップ74へ進む。他方、ステップ72の判
別結果がYESであると、ステップ73は、現在実行中
のタスクの実行権と状態テーブル90中の優先順位レベ
ルが高い実行中のタスクの実行権とを入れ換え、処理は
ステップ74へ進む。ステップ74は、状態テーブル9
0から検索されたタスクの情報が終了したか否かを判定
する。状態テーブル90から検索されていないタスクの
情報が存在し、ステップ74の判定結果がNOである
と、処理はステップ71へ戻る、他方、ステップ74の
判定結果がYESであると、ステップ75は実行権のあ
るタスクを実行するようにタスクの切り替えを行い、処
理は終了する。
Step 72 compares the priority levels of the currently executing task and other currently executing tasks using the state table 90, and executes the currently executing task with a higher priority level than the currently executing task. It is determined whether a task exists. If the decision result in the step 72 is NO, the process proceeds to a step 74 described later. On the other hand, if the decision result in the step 72 is YES, a step 73 replaces the execution right of the currently executing task with the execution right of the executing task having a higher priority level in the status table 90, and Proceed to 74. Step 74 is the state table 9
It is determined whether the information of the task retrieved from 0 has been completed. If there is task information that has not been retrieved from the state table 90 and the determination result in the step 74 is NO, the process returns to the step 71. On the other hand, if the determination result in the step 74 is YES, the step 75 is executed. The task is switched to execute the authorized task, and the process ends.

【0043】これにより、第1のタスクTSK1が休眠
状態にあり、現在第2のタスクTSK2を実行中である
と、状態テーブル90中には第2のタスクTSK2より
優先順位レベルの高い実行中のタスクが存在しないの
で、この状態ではステップ72の判定結果なNOであ
り、第2のタスクTSK2が継続して実行可能である。
他方、第1のタスクTSK1が休眠状態から動作状態へ
復帰すると、これに応じて状態テーブル90の第1のタ
スクTSK1の状態情報がオペレーティングシステムに
より書き換えられ、休止/休眠中ではない状態、割り込
み中ではない状態及び必要な資源待ちの状態が全て
「0」に書き換えられる。この結果、ステップ72の判
定結果がYESとなり、ステップ73で実行権が第2の
タスクTSK2から第1のタスクTSK1へ入れ換えら
れ、最終的にステップ75で実行権のある第1のタスク
TSK1を実行するようにタスクの切り替えを行う。
Thus, if the first task TSK1 is in the sleep state and the second task TSK2 is currently being executed, the status table 90 indicates that the first task TSK1 has a higher priority level than the second task TSK2. Since there is no task, in this state, the determination result in step 72 is NO, and the second task TSK2 can be continuously executed.
On the other hand, when the first task TSK1 returns from the sleep state to the operation state, the state information of the first task TSK1 in the state table 90 is rewritten by the operating system in response to the state, and the state is not in the sleep / sleep state and during the interruption. Are not rewritten to "0". As a result, the determination result at step 72 becomes YES, the execution right is switched from the second task TSK2 to the first task TSK1 at step 73, and finally the first task TSK1 having the execution right is executed at step 75. Switch tasks as you do.

【0044】一般的には、第2のプロトコルに対応する
第2のタスクTSK2が存在しない場合でも、プロトコ
ルに対応した処理以外に対応するタスクが存在する。
又、第1のタスクTSK1に関連した印刷処理やメッセ
ージの表示処理等のタスクが必ず存在する。従って、第
1のタスクTSK1の休眠中にこれらの、第1のタスク
TSK1以外のタスクを実行することで、データ処理装
置の処理効率を向上することができる。
Generally, even when the second task TSK2 corresponding to the second protocol does not exist, there exists a task other than the processing corresponding to the protocol.
In addition, there are always tasks such as print processing and message display processing related to the first task TSK1. Therefore, by executing these tasks other than the first task TSK1 during the sleep of the first task TSK1, the processing efficiency of the data processing device can be improved.

【0045】尚、タスクの切り替えは、CPU11のプ
ログラムカウンタやスタックポインタを書き換えること
で、実現できるが、タスクの切り替え自体は周知であ
り、本発明の要旨とは直接関係がないので、本明細書で
はその説明を省略する。次に、本発明になる記憶媒体の
一実施例を説明する。本実施例では、上記の如き第1の
タスクの休眠タイミング及び休眠時間の制御を行わせる
プログラムが、コンピュータ読み取り可能な記憶媒体に
格納されている。記憶媒体は、図4に示すメモリ12や
ROM13であっても良く、半導体記憶装置、磁気ディ
スク、光ディスク、光磁気ディスク等のディスク状又は
カード状記憶媒体等であっても良い。記憶媒体は、プロ
グラムをコンピュータで読み取り可能な形式に記憶可能
なものであれば特定種類に限定されず、モデムやLAN
等の通信機能や通信手段を介して接続されるコンピュー
タでアクセス可能な記憶媒体をも含む。例えば、記憶媒
体がCD−ROMであれば、このCD−ROMから情報
を読み取るCD−ROMドライバをメモリ12やROM
13等の代わりに設けても、CD−ROMドライバによ
りCD−ROMから読み取ったプログラムをメモリ12
にインストールするようにしても良い。又、記憶媒体
は、上記の如き第1のタスクの休眠タイミング及び休眠
時間の制御を行わせるプログラムに加えて、他のプログ
ラムやデータを記憶していても良い。
The task switching can be realized by rewriting the program counter and the stack pointer of the CPU 11, but the task switching itself is well-known and has no direct relation to the gist of the present invention. Then, the description is omitted. Next, an embodiment of the storage medium according to the present invention will be described. In this embodiment, a program for controlling the sleep timing and the sleep time of the first task as described above is stored in a computer-readable storage medium. The storage medium may be the memory 12 or the ROM 13 shown in FIG. 4, and may be a disk-shaped or card-shaped storage medium such as a semiconductor storage device, a magnetic disk, an optical disk, and a magneto-optical disk. The storage medium is not limited to a specific type as long as the program can store the program in a computer-readable format, and may be a modem or a LAN.
It also includes a storage medium that can be accessed by a computer connected via a communication function or communication means such as. For example, if the storage medium is a CD-ROM, a CD-ROM driver for reading information from this CD-ROM
13 or the like, a program read from a CD-ROM by a CD-ROM driver may be stored in the memory 12.
It may be installed in. Further, the storage medium may store other programs and data in addition to the program for controlling the sleep timing and the sleep time of the first task as described above.

【0046】以上、本発明を実施例により説明したが、
本発明の範囲内で種々の変形及び改良が可能であること
は、言うまでもない。
The present invention has been described with reference to the embodiments.
It goes without saying that various modifications and improvements are possible within the scope of the present invention.

【0047】[0047]

【発明の効果】本発明によれば、オペレーティングシス
テムの変更を行うことなく、複数のタスクに優先順位を
付けて複数のタスクを任意のタイミングで切り替えるこ
とにより、複数のタスクを時分割的に実行可能となる。
According to the present invention, a plurality of tasks are executed in a time-division manner by prioritizing the plurality of tasks and switching the plurality of tasks at an arbitrary timing without changing the operating system. It becomes possible.

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

【図1】プリンタ装置が第1のタスクと第2のタスクを
サポートする場合にリアルタイム処理を可能とする従来
のプログラム制御方法を説明する図である。
FIG. 1 is a diagram illustrating a conventional program control method that enables real-time processing when a printer device supports a first task and a second task.

【図2】本発明の動作原理を説明するためのタスクの実
行タイミングを示す図である。
FIG. 2 is a diagram showing task execution timing for explaining the operation principle of the present invention.

【図3】本発明になるプログラム制御方法、データ処理
装置及び記憶媒体を適用可能なネットワークシステムを
示す図である。
FIG. 3 is a diagram showing a network system to which a program control method, a data processing device, and a storage medium according to the present invention can be applied.

【図4】プリンタ装置の一実施例を示すブロック図であ
る。
FIG. 4 is a block diagram illustrating an embodiment of a printer device.

【図5】タスクの構成を説明する図である。FIG. 5 is a diagram illustrating a configuration of a task.

【図6】実施例におけるタスクの切り替えを説明する図
である。
FIG. 6 is a diagram illustrating task switching in the embodiment.

【図7】シグナル出口関数及びタイマ出口関数の処理を
説明するフローチャートである。
FIG. 7 is a flowchart illustrating processing of a signal exit function and a timer exit function.

【図8】オペレーティングシステムのタスク切り替え処
理を説明するフローチャートである。
FIG. 8 is a flowchart illustrating a task switching process of the operating system.

【図9】オペレーティングシステムが管理している状態
テーブルを説明する図である。
FIG. 9 is a diagram illustrating a state table managed by an operating system.

【符号の説明】[Explanation of symbols]

1,5 LAN 2−1〜2−3 コンピュータ 3−1,3−2 プリンタ装置 3−1a LANアダプタ 11 CPU 12 メモリ 13 ROM 14 タイマ部 15 LAN制御部 16 印刷部 17 バス 21−1,21−2 実行部 22−1,22−2 割り込み部 1,5 LAN 2-1 to 2-3 Computer 3-1 and 3-2 Printer 3-1a LAN adapter 11 CPU 12 Memory 13 ROM 14 Timer unit 15 LAN control unit 16 Printing unit 17 Bus 21-1 and 21- 2 Execution unit 22-1, 22-2 Interrupt unit

Claims (17)

【特許請求の範囲】[Claims] 【請求項1】 第1のタスクと、前記第1のタスクより
優先順位の低い第2のタスクとをオペレーティングシス
テムの制御下で実行するプログラム制御方法であって、 前記オペレーティングシステムの制御下で、前記第1の
タスクの実行中は前記第2のタスクを停止状態に制御
し、前記第1のタスクの停止中は前記第2のタスクを実
行させることにより、前記第1のタスク及び前記第2の
タスクを時分割的に実行させるステップと、 前記第1のタスクが自身の停止タイミングを制御する制
御ステップとを含む、プログラム制御方法。
1. A program control method for executing a first task and a second task having a lower priority than the first task under the control of an operating system, comprising: The second task is controlled to be in a stopped state during the execution of the first task, and the second task is executed while the first task is stopped, so that the first task and the second task are executed. A program control method, comprising: a step of executing the first task in a time-division manner; and a control step of controlling a stop timing of the first task.
【請求項2】 前記制御ステップは、タイマを設定し、
前記タイマにより前記第1のタスクに定期的にシグナル
送信を行い、前記シグナル送信に応答して前記第1のタ
スクを停止状態に制御し、前記第1のタスクのタイマ出
口関数に基づいて停止中の前記第1のタスクを動作状態
に戻す、請求項1記載のプログラム制御方法。
2. The control step includes setting a timer,
The timer periodically transmits a signal to the first task, controls the first task to a stop state in response to the signal transmission, and stops the first task based on a timer exit function of the first task. 2. The program control method according to claim 1, wherein the first task is returned to an operation state.
【請求項3】 前記タイマによる前記第1のタスクの定
期的なシグナル送信の間隔は、前記第1のタスクが連続
的に停止状態にある時間より長く設定されている、請求
項2記載のプログラム制御方法。
3. The program according to claim 2, wherein an interval of the periodic signal transmission of the first task by the timer is set longer than a time during which the first task is continuously stopped. Control method.
【請求項4】 前記タイマ及び前記出口関数は可変設定
される、請求項2又は3記載のプログラム制御方法。
4. The program control method according to claim 2, wherein said timer and said exit function are variably set.
【請求項5】 前記第1のタスクは、前記第2のタスク
を含む複数のタスクのうち最も優先順位が高く設定され
ている、請求項1〜4のいずれか1項記載のプログラム
制御方法。
5. The program control method according to claim 1, wherein the first task has the highest priority among a plurality of tasks including the second task.
【請求項6】 第1のタスクと、前記第1のタスクより
優先順位の低い第2のタスクとをオペレーティングシス
テムの制御下で実行するプロセッサと、 前記オペレーティングシステムの制御下で、前記第1の
タスクの実行中は前記第2のタスクを停止状態に制御
し、前記第1のタスクの停止中は前記第2のタスクを実
行させることにより、前記プロセッサに前記第1のタス
ク及び前記第2のタスクを時分割的に実行させる手段
と、 前記第1のタスクが自身の停止タイミングを制御する制
御手段とを備えた、データ処理装置。
6. A processor executing a first task and a second task having a lower priority than the first task under the control of an operating system; and controlling the first task under the control of the operating system. The second task is controlled to a halt state during execution of the task, and the second task is executed during the halt of the first task, so that the processor causes the processor to execute the first task and the second task. A data processing device comprising: means for executing a task in a time-division manner; and control means for controlling a stop timing of the first task.
【請求項7】 前記制御手段は、 タイマを設定する手段と、 前記タイマにより前記第1のタスクに定期的にシグナル
送信を行う手段と、 前記シグナル送信に応答して前記第1のタスクを停止状
態に制御する手段と、 前記第1のタスクのタイマ出口関数に基づいて停止中の
前記第1のタスクを動作状態に戻す手段とからなる、請
求項6記載のデータ処理装置。
7. The control means includes: means for setting a timer; means for periodically transmitting a signal to the first task by the timer; and stopping the first task in response to the signal transmission. 7. The data processing apparatus according to claim 6, comprising: means for controlling to a state; and means for returning the stopped first task to an operation state based on a timer exit function of the first task.
【請求項8】 前記タイマによる前記第1のタスクの定
期的なシグナル送信の間隔は、前記第1のタスクが連続
的に停止状態にある時間より長く設定されている、請求
項7記載のデータ処理装置。
8. The data according to claim 7, wherein an interval of the periodic signal transmission of the first task by the timer is set longer than a time during which the first task is continuously stopped. Processing equipment.
【請求項9】 前記タイマ及び前記出口関数は可変設定
される、請求項7又は8記載のデータ処理装置。
9. The data processing apparatus according to claim 7, wherein said timer and said exit function are variably set.
【請求項10】 前記第1のタスクは、前記第2のタス
クを含む複数のタスクのうち最も優先順位が高く設定さ
れている、請求項6〜9のいずれか1項記載のデータ処
理装置。
10. The data processing device according to claim 6, wherein the first task has a highest priority among a plurality of tasks including the second task.
【請求項11】 第1のプロトコル及び前記第1のプロ
トコルとは異なる第2のプロトコルに従った要求をネッ
トワークを介して受信すると共に前記ネットワークを介
した情報の送受信を制御するネットワーク部を更に備
え、前記第1及び第2のタスクは夫々該第1及び第2の
プロトコルに対応する、請求項6〜10のいずれか1項
記載のデータ処理装置。
11. A network unit for receiving a request according to a first protocol and a second protocol different from the first protocol via a network, and controlling transmission and reception of information via the network. The data processing apparatus according to any one of claims 6 to 10, wherein the first and second tasks correspond to the first and second protocols, respectively.
【請求項12】 前記第1及び第2のタスクに基づいて
情報を出力する出力装置を更に備えた、請求項6〜11
のいずれか1項記載のデータ処理装置。
12. An apparatus according to claim 6, further comprising an output device for outputting information based on said first and second tasks.
The data processing device according to any one of claims 1 to 4.
【請求項13】 オペレーティングシステムの制御下
で、第1のタスクの実行中は前記第1のタスクより優先
順位の低い第2のタスクを停止状態に制御し、前記第1
のタスクの停止中は前記第2のタスクを実行させること
により、前記第1のタスク及び前記第2のタスクを時分
割的に実行させるデータ処理装置を制御するプログラム
を格納したコンピュータ読み取り可能な記憶媒体であっ
て、 前記データ処理装置を前記第1のタスクが自身の停止タ
イミングを制御する制御手段として機能させるためのプ
ログラムを格納した、記憶媒体。
13. Under the control of an operating system, a second task having a lower priority than the first task is controlled to be stopped during execution of the first task, and
A computer-readable storage storing a program for controlling a data processing device that executes the first task and the second task in a time-division manner by executing the second task while the first task is stopped. A storage medium storing a program for causing the data processing device to function as control means for controlling the timing at which the first task stops itself.
【請求項14】 前記制御手段は、前記データ処理装置
に、タイマを設定させ、前記タイマにより前記第1のタ
スクに定期的にシグナル送信を行わせ、前記シグナル送
信に応答して前記第1のタスクを停止状態に制御させ、
前記第1のタスクのタイマ出口関数に基づいて停止中の
前記第1のタスクを動作状態に戻させる、請求項13記
載の記憶媒体。
14. The control means causes the data processing device to set a timer, causes the first task to periodically transmit a signal by the timer, and responds to the signal transmission by the first task. Control the task to a suspended state,
14. The storage medium according to claim 13, wherein the stopped first task is returned to an operation state based on a timer exit function of the first task.
【請求項15】 前記タイマによる前記第1のタスクの
定期的なシグナル送信の間隔は、前記第1のタスクが連
続的に停止状態にある時間より長く設定されている、請
求項14記載の記憶媒体。
15. The storage according to claim 14, wherein an interval of the periodic signal transmission of the first task by the timer is set longer than a time during which the first task is continuously stopped. Medium.
【請求項16】 前記タイマ及び前記出口関数は可変設
定される、請求項14又は15記載の記憶媒体。
16. The storage medium according to claim 14, wherein said timer and said exit function are variably set.
【請求項17】 前記第1のタスクは、前記第2のタス
クを含む複数のタスクのうち最も優先順位が高く設定さ
れている、請求項13〜16のいずれか1項記載の記憶
媒体。
17. The storage medium according to claim 13, wherein the first task has a highest priority set among a plurality of tasks including the second task.
JP11724698A 1998-04-27 1998-04-27 Program control method, data processor and storage medium Pending JPH11306033A (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
JP11724698A JPH11306033A (en) 1998-04-27 1998-04-27 Program control method, data processor and storage medium
PCT/JP1999/001656 WO1999056208A1 (en) 1998-04-27 1999-03-31 Method of controlling program, data processor, and recording medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP11724698A JPH11306033A (en) 1998-04-27 1998-04-27 Program control method, data processor and storage medium

Publications (1)

Publication Number Publication Date
JPH11306033A true JPH11306033A (en) 1999-11-05

Family

ID=14707016

Family Applications (1)

Application Number Title Priority Date Filing Date
JP11724698A Pending JPH11306033A (en) 1998-04-27 1998-04-27 Program control method, data processor and storage medium

Country Status (2)

Country Link
JP (1) JPH11306033A (en)
WO (1) WO1999056208A1 (en)

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CA2167633A1 (en) * 1995-01-23 1996-07-24 Leonard R. Fishler Apparatus and method for efficient modularity in a parallel, fault tolerant, message based operating system
JPH09251389A (en) * 1996-03-14 1997-09-22 Omron Corp Data processor

Also Published As

Publication number Publication date
WO1999056208A1 (en) 1999-11-04

Similar Documents

Publication Publication Date Title
JP4580845B2 (en) Task execution device
US8793695B2 (en) Information processing device and information processing method
US6715016B1 (en) Multiple operating system control method
US10884786B2 (en) Switch device, switching method, and computer program product
US20060010446A1 (en) Method and system for concurrent execution of multiple kernels
JPH03147151A (en) File server sharing graftable resource using common routine
JP2002099433A (en) System of computing processing, control method system for task control, method therefor and record medium
EP1026579B1 (en) Network-connectable printer, controller therefor, and method for controlling this controller
US8423681B2 (en) Control apparatus for process input-output device
US5835767A (en) Method and apparatus for controlling available processor capacity
JPH11306033A (en) Program control method, data processor and storage medium
JP2003271349A (en) System and method for managing and processing print job using print job ticket
WO2023218596A1 (en) Intra-server delay control device, intra-server delay control method, and program
JP2000148639A (en) Data transmission control method and recording medium with data transmission control program recorded therein
JPH1196108A (en) Computer system and bus control device
JPH10254721A (en) Printing device, interruption request processing method and storage medium
WO2023199519A1 (en) Intra-server delay control device, intra-server delay control method, and program
JP2000066855A (en) Image forming device and image data reception control method therefor
JP2007219925A (en) Bus controller, bus control program and recording medium
JP2000029850A (en) Task controlling method using inter-processor communication of operating system
JP2006244293A (en) Tag execution control method and device
KR960006472B1 (en) Fddi firmware driving method for ticom iop environment
JPH06274436A (en) Data transfer system
JP2006350891A (en) Communication device
JPH03250968A (en) Input output device

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20040608

A131 Notification of reasons for refusal

Effective date: 20060131

Free format text: JAPANESE INTERMEDIATE CODE: A131

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20060330

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20060425

A02 Decision of refusal

Effective date: 20060815

Free format text: JAPANESE INTERMEDIATE CODE: A02