JPH03248231A - Multitask exclusive control method - Google Patents
Multitask exclusive control methodInfo
- Publication number
- JPH03248231A JPH03248231A JP4667490A JP4667490A JPH03248231A JP H03248231 A JPH03248231 A JP H03248231A JP 4667490 A JP4667490 A JP 4667490A JP 4667490 A JP4667490 A JP 4667490A JP H03248231 A JPH03248231 A JP H03248231A
- Authority
- JP
- Japan
- Prior art keywords
- exclusive
- task
- system call
- flag
- interrupt
- 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
- 238000000034 method Methods 0.000 title claims description 11
- 238000012545 processing Methods 0.000 claims abstract description 13
- 230000004044 response Effects 0.000 claims abstract description 7
- 230000007717 exclusion Effects 0.000 claims description 6
- 239000000725 suspension Substances 0.000 claims 1
- 230000000873 masking effect Effects 0.000 abstract description 3
- 238000010586 diagram Methods 0.000 description 6
- 238000012544 monitoring process Methods 0.000 description 4
- 230000000694 effects Effects 0.000 description 3
- 230000003213 activating effect Effects 0.000 description 2
- 238000007796 conventional method Methods 0.000 description 1
- 239000000284 extract Substances 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
Abstract
Description
【発明の詳細な説明】
〔産業上の利用分野〕
本発明は、マルチタスクオペレーティングシステム(以
下「O8」と称する。)における、タスクの排他制御方
法に関するものである。DETAILED DESCRIPTION OF THE INVENTION [Field of Industrial Application] The present invention relates to a method for exclusive control of tasks in a multitasking operating system (hereinafter referred to as "O8").
マルチタスクO8において、実行中のタスクから他のタ
スクに実行権が移行する要因として、システムコールに
よるソフトウェア割込みと、ハードウェアによるハード
ウェア割込みがある。In multitasking O8, factors that cause the execution right to be transferred from the task being executed to another task include software interrupts caused by system calls and hardware interrupts caused by hardware.
第4図は従来のスーパーバイザの構成図である。従来の
マルチタスクO8下においては、ソフトウェア割込みが
生じた場合スーパーバイザ41において、中断処理42
を経てシステムコール管理43に通知され、システムコ
ール44が起動される。システムコール44における処
理の後、ディスパッチャ46に制御が移行しディスパッ
チングが行なわれ、レディタスク又は発呼元のタスクに
もどる。FIG. 4 is a block diagram of a conventional supervisor. Under the conventional multitasking O8, when a software interrupt occurs, the supervisor 41 executes the interrupt processing 42.
The system call management 43 is notified via , and the system call 44 is activated. After processing in the system call 44, control is transferred to the dispatcher 46 to perform dispatching and return to the ready task or the calling task.
一方、ハードウェア割込みが生じた場合、ス−パーバイ
ザ41において、中断処理42を経た後、割込み応答4
5が起動される。その後ディスパッチャ46においてデ
ィスパッチングがなされ、レディタスク又は発呼元のタ
スクにもどる。On the other hand, when a hardware interrupt occurs, in the supervisor 41, after passing through the interrupt processing 42, the interrupt response 4
5 is activated. Thereafter, dispatching is performed by the dispatcher 46, and the task returns to the ready task or the calling task.
係る場合に実行中のタスクを除く他のタスクの実行を禁
止するときには、実行中のタスク内でシステムコールを
使用せず、ソフトウェア割込みの発生を防ぎ、かつ全て
のハードウェア割込みをマスクし、タスクの実行権が他
のタスクに移行する原因を断つことにより実現していた
。In such cases, when prohibiting the execution of tasks other than the currently executing task, do not use system calls within the currently executing task, prevent the occurrence of software interrupts, and mask all hardware interrupts. This was achieved by cutting off the cause of the execution privileges being transferred to other tasks.
しかし、このような従来の方法では、以下の問題点があ
る。However, such conventional methods have the following problems.
(1)自タスク内において、時間待ち、又は時間監視の
システムコールが使用できないために、時間待ち、又は
時間監視を行う場合、別途にソフトウェアによるソフト
タイマを作成することにより対応をする必要がある。(1) When performing time waiting or time monitoring because the system call for time waiting or time monitoring cannot be used within the own task, it is necessary to deal with this by creating a separate soft timer using software. .
しかし、ソフトタイマは、CPUの処理スピードに依存
してしまうため、CPUの処理スピードが異なる装置間
では正確な時間を得るために修正が必要となる。However, since the soft timer depends on the processing speed of the CPU, modification is required to obtain accurate time between devices with different CPU processing speeds.
(2)自タスク以外のタスクが、ハードウェアタイマを
利用した時間待ち、又は時間監視のシステムコールを使
用して待ち状態であった場合、当該タスクは、ハードウ
ェア割込みがマスクされているため正確なサービスを受
けることが困難である。(2) If a task other than the invoking task is waiting for time using a hardware timer or using a time monitoring system call, the task in question will not be accurate because hardware interrupts are masked. It is difficult to receive appropriate services.
本発明は、上述した問題点を除去するためにハードウェ
ア割込みをマスクすることなしに、タスクの排他制御を
実現する方法を提供することを目的とする。An object of the present invention is to provide a method for realizing exclusive control of tasks without masking hardware interrupts in order to eliminate the above-mentioned problems.
上記課題を解決するために本発明は、タスクの排他制御
の状態を示す排他フラグと、前記排他フラグをセットす
る排他開始手段と、前記排他フラグをリセットする排他
終了手段と、前記排他フラグを記憶する記憶手段と、前
記記憶手段によって記憶された排他フラグによりディス
パッチャを制御するする排他管理手段を備えたことを特
徴とする。In order to solve the above problems, the present invention provides an exclusive flag indicating a state of exclusive control of a task, exclusive start means for setting the exclusive flag, exclusive end means for resetting the exclusive flag, and storing the exclusive flag. The present invention is characterized in that it includes a storage means for controlling a dispatcher, and an exclusive management means for controlling a dispatcher using an exclusive flag stored by the storage means.
本発明では、排他開始手段において排他フラグをセット
することによりタスクを排他状態とし、当該排他フラグ
を記憶手段によって保持するため、以後排他終了手段に
おいて前記排他フラグがクリアされることにより排他状
態が解除されるまで該タスクは排他状態となる。従って
71−ドウエア割込みをマスクすることなく、該タスク
の排他状態が実現される。In the present invention, the exclusive flag is set in the exclusive start means to put the task in the exclusive state, and the exclusive flag is held in the storage means, so that the exclusive state is released by clearing the exclusive flag in the exclusion end means. The task is in an exclusive state until it is Therefore, the exclusive state of the task is realized without masking the 71-ware interrupt.
以下、本発明の実施例を図面に基づいて説明する。 Embodiments of the present invention will be described below based on the drawings.
第1図は本発明の一実施例を示すスーパーバイザの構成
図である、1はマルチタスクO8中で割込みによって起
動されタスクの実行制御を行なうスーパーバイザ、2は
割込み発生時に実行中であったタスクの中断を行なう中
断処理、3はタスクから要求のあったシステムコールを
起動するシステムコール管理、4は従来のシステムコー
ルレ、5はハードウェア割込みに対する割込み応答、6
はレディ状態のタスク中より次に実行すべきタスクを抽
出し制御を渡すディスパッチャ、7はタスクの排他制御
の状態を示す排他フラグ、8は排他フラグを論理値”1
”とする排他開始システムコール、9は排他フラグを論
理値′”0”とする排他終了システムコール、10は排
他フラグによりタスクサービスを制御する排他管理であ
る。FIG. 1 is a configuration diagram of a supervisor showing an embodiment of the present invention. 1 is a supervisor that is activated by an interrupt in the multitasking O8 and controls the execution of tasks; 2 is a supervisor that controls the execution of tasks that are being executed when an interrupt occurs; 3 is a system call management that starts a system call requested by a task; 4 is a conventional system call; 5 is an interrupt response to a hardware interrupt; 6
is a dispatcher that extracts the next task to be executed from among the tasks in the ready state and transfers control to it, 7 is an exclusive flag indicating the state of exclusive control of the task, and 8 is an exclusive flag with a logical value of "1"
9 is an exclusive end system call that sets the exclusive flag to the logical value ``0'', and 10 is exclusive management that controls the task service using the exclusive flag.
次に第1図の動作について説明する。ソフトウェア割込
みが生じた場合、スーパーバイザ1において、まず中断
処理2による処理が行なわれる。Next, the operation shown in FIG. 1 will be explained. When a software interrupt occurs, the supervisor 1 first performs an interruption process 2.
中断処理2は割り込みが生じた時点のCPUやプログラ
ムの状況を示す情報を保持する。中断処理2による処理
の後、当該ソフトウェア割込みはシステムコール管理3
に通知され、システムコール管理3においていかなるシ
ステムコールを起動すべきかの判断が行なわれる。排他
開始システムコール8の実行依頼は、ソフトウェア割込
みによりスーパバイザ1において中断処理2を経てシス
テムコール管理3に通知され、ここで排他開始システム
コール8を起動することにより実現される。Interruption processing 2 holds information indicating the status of the CPU and program at the time the interrupt occurs. After processing by interrupt processing 2, the software interrupt is processed by system call management 3.
The system call management 3 determines what system call should be activated. A request for execution of the exclusive start system call 8 is notified to the system call management 3 through an interruption process 2 in the supervisor 1 by a software interrupt, and is realized by activating the exclusive start system call 8 here.
排他開始システムコール8は、排他フラグ7を論理値”
1”として終了する。排他開始システムコール8の終了
の後、排他管理10へ処理が移行する。排他管理10に
おいて、排他フラグ7の論理値が1”であるか否かの分
岐が行なわれるが、上記の場合には排他フラグ7の論理
値が”1″であるので、ディスパッチ〜6を回避して排
他開始システムコールの実行依頼元にリターンする。以
後、ソフトウェア割込みによって、従来のシステムコー
ル4の実行依頼があった場合、従来のシステムコール4
の終了の後、排他管理10において排他フラグ7は論理
値”1”と判断されるためディスパッチャ6は回避され
る。またハードウェア割込みによる場合も、中断処理2
、割込み応答5が行なわれた後、排他管理10において
排他フラグ7が論理値”1”と判断きれるため、ディス
パッチャ6は回避される。従ってスーパーバイザ1は、
ソフトウェア又はハードウェア何れの割込みに対しても
、タスクの実行権を切り換える動作をせず、タスクの排
他状態が実現される。Exclusion start system call 8 sets exclusive flag 7 to a logical value "
1". After the exclusion start system call 8 ends, the process moves to the exclusive management 10. In the exclusive management 10, a branch is made to determine whether the logical value of the exclusive flag 7 is 1". In the above case, since the logical value of the exclusive flag 7 is "1", dispatch to 6 is avoided and the process returns to the execution request source of the exclusive start system call. From now on, if a software interrupt requests the execution of conventional system call 4, the conventional system call 4 will be executed.
After completion of the process, the exclusive flag 7 is determined to have a logical value of "1" in the exclusive management 10, so the dispatcher 6 is avoided. Also, in the case of a hardware interrupt, interruption processing 2
, after the interrupt response 5 is performed, the exclusive flag 7 can be determined to have a logical value of "1" in the exclusive management 10, so the dispatcher 6 is avoided. Therefore, Supervisor 1 is
In response to either software or hardware interrupts, the exclusive state of the tasks is achieved without switching the execution right of the tasks.
上記タスクの排他状態を解除する唯一の手段はスーパー
バイザ1が排他終了システムコール9の実行依頼を受け
ることである。The only means to release the exclusive state of the task is for the supervisor 1 to receive a request to execute the exclusive termination system call 9.
排他終了システムコール9の実行依頼は、ソフトウェア
割込みによりスーパーバイザ1において中断処理2を経
てシステムコール管理3に通知され、ここで排他終了シ
ステムコール9を起動することにより実現される。The execution request for the exclusive termination system call 9 is notified to the system call management 3 through the interruption process 2 in the supervisor 1 by a software interrupt, and is realized by activating the exclusive termination system call 9 here.
排他終了システムコール9は排他フラグ7を論理値”0
”として終了し、次いで排他管理10において排他フラ
グ7の論理値が”1”であるか否かの分岐が行なわれる
。上記場合は排他フラグ7の論理値が”O”であるので
、ディスパッチャ6が起動をかけられ、以降全てのレデ
ィ状態にあるタスクへ実行権が移行可能な状態となる。The exclusive end system call 9 sets the exclusive flag 7 to the logical value "0".
", and then in the exclusive management 10, a branch is made to determine whether the logical value of the exclusive flag 7 is "1". In the above case, since the logical value of the exclusive flag 7 is "O", the dispatcher 6 is activated, and from then on, execution rights can be transferred to all tasks in the ready state.
第2図は、上述の動作をタイムチャートに表わした図で
ある。FIG. 2 is a diagram showing the above-mentioned operation in a time chart.
排他開始システムコールが実行されたことによって、排
他フラグが論理値”1”と詐れる。該排他フラグは排他
終了システムコールが実行されるまで保持される。従っ
て該排他フラグが論理値°′1”の間、現在実行中のタ
スクのみがサービスされる。Due to the execution of the exclusive start system call, the exclusive flag becomes a logical value "1". The exclusive flag is held until the exclusive end system call is executed. Therefore, while the exclusive flag is at the logical value '1', only the currently executing task is serviced.
また、第3図は本発明に係るマルチタスクO8の適用が
可能な標準的なシステム構成を示すブロック図である。Further, FIG. 3 is a block diagram showing a standard system configuration to which the multitasking O8 according to the present invention can be applied.
メモリ32、プリンタ33、デイスプレィ33、キーボ
ード35、ディスク36がバス37を介してCPU31
に接続きれている。なお、スーパーバイザ1はCPU3
1内に存在し、また、排他フラグ7は、メモリ32中の
主記憶(図示せず)に存在するものとする。A memory 32, a printer 33, a display 33, a keyboard 35, and a disk 36 are connected to the CPU 31 via a bus 37.
The connection is broken. In addition, supervisor 1 is CPU 3
It is assumed that the exclusive flag 7 exists in the main memory (not shown) in the memory 32.
〔発明の効果〕
以・上実施例に基づいて説明したように本発明では、
(1)ハードタイマによる割込みをマスクしないので、
時間待ち、時間監視のシステムコールが全てのタスクで
使用可能となる。[Effects of the Invention] As explained above based on the embodiments, the present invention has the following advantages: (1) Since the interrupt by the hard timer is not masked,
Time waiting and time monitoring system calls can be used by all tasks.
(2)ハードタイマによる割込み以外の割込みもマスク
する必要がないため、リアルタイムに割込み処理するこ
とが可能である。(2) Since there is no need to mask interrupts other than those caused by the hard timer, it is possible to process interrupts in real time.
と、いう優れた効果を有する。It has an excellent effect.
第1図は、本発明の一実施例を示すスーパーバ係るマル
チタスクO8の適用が可能な標準的なシステム構成を示
すブロック図、第4図は、従来のスーパーバイザの構成
図である。
1・・・スーパーバイザ、2・・・中断処理、3・・・
システムコール管理、4・・・従来のシステムコール、
5・・・割込み応答、6・・・ディスパッチャ、7・・
・排他フラグ、8・・・排他開始システムコール、9・
・・排他終了システムコール、10・・・排他管理。FIG. 1 is a block diagram showing a standard system configuration to which a multitasking O8 related to a supervisor can be applied, showing an embodiment of the present invention, and FIG. 4 is a configuration diagram of a conventional supervisor. 1... Supervisor, 2... Interruption processing, 3...
System call management, 4... Conventional system call,
5... Interrupt response, 6... Dispatcher, 7...
・Exclusion flag, 8... Exclusion start system call, 9.
...Exclusive end system call, 10...Exclusive management.
Claims (1)
、及びハードウェア資源の管理を行ない、前記タスクの
中断処理、システムコール管理、システムコール処理、
割り込み応答手段及びディスパッチャを有するスーパー
バイザにおいて、前記タスクの排他制御の状態を示す排
他フラグと、 前記排他フラグをセットする排他開始手段と、前記排他
フラグをリセットする排他終了手段と、 前記排他フラグを記憶する記憶手段と、 前記記憶手段によって記憶された前記排他フラグにより
前記ディスパッチャを制御する排他管理手段とを具備し
たことを特徴とするマルチタスクの排他制御方法。[Scope of Claims] Management of the task and management of hardware resources leading to startup, execution, and termination of the task, suspension processing of the task, system call management, system call processing,
In a supervisor having an interrupt response means and a dispatcher, an exclusive flag indicating a state of exclusive control of the task, an exclusive start means for setting the exclusive flag, an exclusive end means for resetting the exclusive flag, and storing the exclusive flag. A multi-task exclusive control method, comprising: storage means for controlling the dispatcher using the exclusion flag stored by the storage means;
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP4667490A JPH03248231A (en) | 1990-02-26 | 1990-02-26 | Multitask exclusive control method |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP4667490A JPH03248231A (en) | 1990-02-26 | 1990-02-26 | Multitask exclusive control method |
Publications (1)
Publication Number | Publication Date |
---|---|
JPH03248231A true JPH03248231A (en) | 1991-11-06 |
Family
ID=12753921
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP4667490A Pending JPH03248231A (en) | 1990-02-26 | 1990-02-26 | Multitask exclusive control method |
Country Status (1)
Country | Link |
---|---|
JP (1) | JPH03248231A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2014004804A (en) * | 2012-06-27 | 2014-01-16 | Seiko Epson Corp | Control method for printer and printer |
-
1990
- 1990-02-26 JP JP4667490A patent/JPH03248231A/en active Pending
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2014004804A (en) * | 2012-06-27 | 2014-01-16 | Seiko Epson Corp | Control method for printer and printer |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US6892261B2 (en) | Multiple operating system control method | |
US5390329A (en) | Responding to service requests using minimal system-side context in a multiprocessor environment | |
US5721922A (en) | Embedding a real-time multi-tasking kernel in a non-real-time operating system | |
US6128641A (en) | Data processing unit with hardware assisted context switching capability | |
US6006247A (en) | Method and system for scheduling threads and handling exceptions within a multiprocessor data processing system | |
US5666523A (en) | Method and system for distributing asynchronous input from a system input queue to reduce context switches | |
EP1162536A1 (en) | Multiple operating system control method | |
JP2001282558A (en) | Multi-operating computer system | |
JP3644042B2 (en) | Multitask processing device | |
JP3245500B2 (en) | Event management method in multi-programming | |
JPH03248231A (en) | Multitask exclusive control method | |
JP2693916B2 (en) | Task scheduling method | |
JPH09160790A (en) | Device and method for task schedule | |
JPH1124946A (en) | Device and method for scheduling task | |
JPH02220138A (en) | Interruption protecting system for real time operating system | |
JPH08297580A (en) | Input/output control method | |
JPH0981526A (en) | Multiprocessor system | |
WO1992003783A1 (en) | Method of implementing kernel functions | |
Lister et al. | The System Nucleus | |
KR20050049170A (en) | Apparatus and method for handling interrupt in non-privileged of embedded system | |
JPH08320809A (en) | Disturbance process exclusion system | |
JP2822728B2 (en) | Computer system | |
CN118796446A (en) | A thread destruction method and device for a multi-core processor | |
JP2607595B2 (en) | Queuing table search method | |
JPH10247161A (en) | Memory management system |