JPH0667898A - Task control system - Google Patents

Task control system

Info

Publication number
JPH0667898A
JPH0667898A JP4217597A JP21759792A JPH0667898A JP H0667898 A JPH0667898 A JP H0667898A JP 4217597 A JP4217597 A JP 4217597A JP 21759792 A JP21759792 A JP 21759792A JP H0667898 A JPH0667898 A JP H0667898A
Authority
JP
Japan
Prior art keywords
task
program
memory
address
storage area
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
JP4217597A
Other languages
Japanese (ja)
Inventor
Tetsuya Sonoyama
哲也 園山
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
NEC Solution Innovators Ltd
Original Assignee
NEC Solution Innovators 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 NEC Solution Innovators Ltd filed Critical NEC Solution Innovators Ltd
Priority to JP4217597A priority Critical patent/JPH0667898A/en
Publication of JPH0667898A publication Critical patent/JPH0667898A/en
Pending legal-status Critical Current

Links

Abstract

PURPOSE:To attain a controllable program by securing a storage area for task control information inherent in each task in respect to a program solely existing in the storage area. CONSTITUTION:This task control system is constituted of only a program 11 solely existing in the storage area, a common memory 12 to be a storage area common to plural tasks, task memories 13, 19 to be independent storage areas in each task, an execution task memory address 15 included in the common memory to specify a task memory corresponding to each task, task stacks 14, 17 independently existing in each task and automatically allocated at their addresses, and saved task memory addresses 16, 18 included in respective task stacks 14, 17, and when a current task is switched, storing the execution task memory address of the task executed up to the switching time.

Description

【発明の詳細な説明】Detailed Description of the Invention

【0001】[0001]

【産業上の利用分野】本発明はタスク制御方式に関し、
特に記憶領域内に唯一存在するプログラムのタスク制御
方式に用いるタスク制御方式に関する。
BACKGROUND OF THE INVENTION The present invention relates to a task control system,
In particular, the present invention relates to a task control method used for the task control method of a program which exists only in a storage area.

【0002】[0002]

【従来の技術】従来のタスク制御方式は、タスク実行時
に記憶領域内に唯一存在するプログラムが制御する記憶
領域に関し、タスク毎に独立した任意に割付可能な記憶
領域、すなわち前記プログラムによって任意にアドレス
を割り付けてタスク毎に制御情報を格納するタスクメモ
リは存在せず、自動的に割付られて該タスク実行に際し
前記プログラムが一時的なプログラム制御情報を格納す
るタスクスタックと、タスク共通に唯一存在し、前記プ
ログラムが実行時にタスクに共通なプログラム制御情報
を格納する共通メモリだけであった。
2. Description of the Related Art A conventional task control method relates to a storage area controlled only by a program that exists in the storage area at the time of executing a task. There is no task memory that allocates the control information for each task, and is uniquely shared by the task stack and the task stack that is automatically allocated by the program to store temporary program control information when the task is executed. The program has only a common memory that stores program control information common to tasks at the time of execution.

【0003】また、プログラムの実行時において、タス
クスタックへの記憶領域の割り当てが行われるのは、例
えばC言語では、内部変数を使う関数を実行する場合
や、関数を呼び出す際にレジスタ情報を退避する場合な
どであり、記憶領域内におけるタスクスタックの位置は
固定できなかった。
In addition, the storage area is allocated to the task stack at the time of executing the program. For example, in C language, register information is saved when executing a function that uses an internal variable or when calling a function. However, the position of the task stack in the storage area could not be fixed.

【0004】[0004]

【発明が解決しようとする課題】上述した従来のタスク
制御方式は、共通メモリは総てのタスクに対し共通な記
憶領域であるので、タスク固有の情報はタスクスタック
上に確保しなければならず、また、必要なタスクスタッ
クの大きさの特定が困難になりプログラムが複雑になる
という欠点があった。
In the above-mentioned conventional task control system, since the common memory is a storage area common to all tasks, task-specific information must be secured on the task stack. Also, there is a drawback that it becomes difficult to specify the size of the required task stack and the program becomes complicated.

【0005】[0005]

【課題を解決するための手段】本発明のタスク制御方式
は、記憶領域内に唯一存在するプログラムと、前記プロ
グラムが実行時にタスクに共通なプログラム制御情報を
格納する共通メモリと、任意のタスクによる前記プログ
ラム実行時に、前記プログラムによって任意にアドレス
を割り付けてタスク毎に制御情報を格納するタスクメモ
リと、前記プログラムが前記タスクメモリのアドレスを
格納する、前記共通メモリに存在する実行タスクメモリ
アドレスと、タスクが起動される時に自動的にアドレス
割り付けされ、タスク実行に際し一時的なプログラム制
御情報を格納するタスクスタックと、タスクが切り換え
られた際に、それまで実行していたタスクの前記実行タ
スクメモリアドレスを前記プログラムが格納する、タス
クスタックに存在する退避タスクメモリアドレス、とを
備える。
A task control system according to the present invention comprises a program which exists only in a storage area, a common memory which stores program control information common to the tasks when the program is executed, and an arbitrary task. A task memory that stores control information for each task by arbitrarily assigning an address by the program when the program is executed, and an execution task memory address that exists in the common memory and that stores the address of the task memory by the program, The address is automatically assigned when the task is started, and the task stack that stores temporary program control information when the task is executed and the execution task memory address of the task that was being executed until the task was switched Exists in the task stack where the above program stores That saving task memory address, and a city.

【0006】[0006]

【実施例】次に、本発明の実施例について、C言語を例
に、図面を参照して説明する。
Embodiments of the present invention will now be described with reference to the drawings, using the C language as an example.

【0007】図1は本発明のタスク制御方式の一実施例
のメモリマップである。
FIG. 1 is a memory map of an embodiment of the task control system of the present invention.

【0008】本メモリマップは、タスクAとタスクBと
いう2つのタスクが制御する場合の例である。
This memory map is an example in which two tasks, task A and task B, are controlled.

【0009】11は、プログラムであり、記憶領域内に
唯一存在し複数のタスクが実行する。
Reference numeral 11 denotes a program, which exists only in the storage area and is executed by a plurality of tasks.

【0010】12は、共通メモリであり、プログラム1
1の実行により制御される。例えば、C言語における外
部変数や静的変数を含んでいる。
A common memory 12 is a program 1
Controlled by execution of 1. For example, it includes external variables and static variables in C language.

【0011】13、19は、タスクメモリであり、タス
クの数だけ存在しタスク固有の情報を記憶する。本実施
例ではタスクA用とタスクB用が存在する。
Reference numerals 13 and 19 denote task memories, which are present by the number of tasks and store task-specific information. In this embodiment, there are tasks A and B.

【0012】14、17は、タスクスタックであり、タ
スクの数だけ存在しタスクにおいてプログラム11を実
行する際に例えば、C言語における内部変数や関数呼出
時のレジスタ退避に使用する。本実施例ではタスクA用
とタスクB用が存在する。
Numerals 14 and 17 denote task stacks, which are present as many as the number of tasks and are used, for example, for saving internal variables in C language and registers for calling a function when executing the program 11. In this embodiment, there are tasks A and B.

【0013】15は、実行タスクメモリアドレスであ
り、共通メモリ12に存在し実行中のタスクのタスクメ
モリ13のアドレスを格納する。
Reference numeral 15 denotes an execution task memory address, which stores the address of the task memory 13 of the task which is present in the common memory 12 and is being executed.

【0014】16、18は、退避タスクメモリアドレス
であり、タスクスタック14、17に存在しタスク毎に
対応したタスクメモリ13、19のアドレスを格納す
る。本実施例ではタスクA用とタスクB用が存在する。
Reference numerals 16 and 18 denote evacuation task memory addresses, which store the addresses of the task memories 13 and 19 existing in the task stacks 14 and 17 and corresponding to each task. In this embodiment, there are tasks A and B.

【0015】図2および図3は、本実施例のタスク制御
方式における動作の一例を示す流れ図である。
2 and 3 are flow charts showing an example of the operation in the task control system of this embodiment.

【0016】図2および図3は、記憶領域内に唯一存在
するプログラム11をタスクAとタスクBという2つの
タスクが実行する手順を図示している。
2 and 3 show a procedure in which two tasks, task A and task B, execute the program 11 which is uniquely present in the storage area.

【0017】タスクAおよびタスクBのタスク制御はO
Sが管理していると仮定して説明する。
The task control of task A and task B is O
Description will be made assuming that S manages.

【0018】最初に、タスクAが開始され、プログラム
11の実行を開始する(処理2001)。この際、タス
クAの制御のもとでプログラム11が使用するタスクA
用タスクスタック14のアドレスは、OSによって既に
決定されている。このタスクスタック14は、タスクA
を終了しない限りタスクAに対応してOSが管理してい
る。
First, the task A is started, and the execution of the program 11 is started (process 2001). At this time, the task A used by the program 11 under the control of the task A
The address of the task stack 14 for use is already determined by the OS. This task stack 14 is task A
Unless the process is terminated, the OS manages the task A.

【0019】次にプログラム11はタスクA固有の情報
を読み書き制御するためのタスクA用タスクメモリ13
のアドレスを決定し、タスクA制御下における以降の動
作で参照するために、共通メモリ12内の実行タスクメ
モリアドレス15にタスクA用タスクメモリ13のアド
レスを格納する(処理2002)。
Next, the program 11 is a task memory 13 for task A for reading and writing information specific to task A.
The address of the task memory 13 for task A is stored in the execution task memory address 15 in the common memory 12 so as to be referred to in the subsequent operation under the control of the task A (process 2002).

【0020】次に、プログラム11の本来の処理である
処理Aを実行する(処理2003)。
Next, the process A which is the original process of the program 11 is executed (process 2003).

【0021】そして、通常、処理Aが完了したらプログ
ラム11においてタスクAをサスペンドするのである
が、あるタスクがサスペンドすると、一般的には、OS
の制御においてタスク切り替えが行われ、実行待ち状態
になっているタスクが次に実行される。本実施例ではタ
スクBが次に実行されるのであるが、このままタスクA
からタスクBに実行を切り替えてしまうと、タスクA用
のタスクメモリ13のアドレス即ち実行タスクメモリア
ドレス15は前述した様に、タスクB用のタスクメモリ
19のアドレスに上書きされてしまう。そこで、プログ
ラム11はタスクAをサスペンドする前に、実行タスク
メモリアドレス15に記憶しているタスクA用のタスク
メモリ13のアドレスをタスクA用のタスクスタック1
4内の退避タスクメモリアドレス16に格納して、タス
クAが再開したときに再びタスクA用タスクメモリ13
を参照できるようにする(処理2004)。
Normally, when the process A is completed, the task A is suspended in the program 11, but when a certain task is suspended, the OS is generally suspended.
The task switching is performed under the control of 1., and the task in the execution waiting state is executed next. In this embodiment, the task B is executed next, but the task A is left as it is.
When the execution is switched from the task B to the task B, the address of the task memory 13 for the task A, that is, the execution task memory address 15 is overwritten with the address of the task memory 19 for the task B as described above. Therefore, the program 11 sets the address of the task memory 13 for task A stored in the execution task memory address 15 to the task stack 1 for task A before suspending the task A.
4 is stored in the saved task memory address 16 in 4 and the task memory 13 for the task A is stored again when the task A is restarted.
Can be referred to (process 2004).

【0022】続いて、プログラム11はタスクAをサス
ペンドし、OSに制御を渡す。この場合、タスクAの実
行は終了していないものとする(処理2005)。
Subsequently, the program 11 suspends the task A and transfers control to the OS. In this case, execution of task A is not completed (process 2005).

【0023】次に、OSのタスク制御によってタスク切
り換えが起こりタスクBが開始され、プログラム11の
実行を開始する(処理2008)。
Next, task switching is caused by the task control of the OS, task B is started, and execution of the program 11 is started (process 2008).

【0024】ここで、以降の処理2008から処理20
12によるプログラム11の動きは既に述べたタスクA
の場合と全く同じであり、タスクB用タスクスタック1
7、タスクB用退避タスクメモリアドレス18、タスク
B用タスクメモリ19を使用することだけが異なる。
Here, the subsequent processing 2008 to processing 20
The movement of the program 11 by 12 is the task A already described.
It is exactly the same as the case of Task B for task B 1
7, the task B save task memory address 18 and the task B task memory 19 are only used.

【0025】次に、OSのタスク制御によってタスク切
り替えが起こりタスクAが再開され、プログラム11の
実行を再開する(処理2006)。
Next, task switching occurs under the task control of the OS, task A is restarted, and execution of the program 11 is restarted (process 2006).

【0026】ここで、処理2004で記憶したタスクA
用タスクメモリ13のアドレスを、タスクA用退避タス
クメモリアドレス16から読みだして、これを実行タス
クメモリアドレス15に格納する(処理2007)。
Here, the task A stored in the process 2004
The address of the task memory 13 for read is read from the save task memory address 16 for task A and stored in the executed task memory address 15 (process 2007).

【0027】以降のプログラム11の処理は、タスク開
始の場合の処理2003以降、処理2003から処理2
005と同じでよいことは、また明らかである。
Subsequent processing of the program 11 is from processing 2003 when the task is started, processing from processing 2003 to processing 2
It is also clear that it can be the same as 005.

【0028】以上によって、マルチタスク配下で処理を
行なうプログラム11は、タスク固有の制御情報を記憶
するタスクメモリ13、19を任意に割り当てることが
可能となる。
As described above, the program 11 which performs processing under the multitasking can arbitrarily allocate the task memories 13 and 19 for storing the control information unique to the task.

【0029】[0029]

【発明の効果】以上説明したように、本発明のタスク制
御方式は、記憶領域内に唯一存在し逐次実行するプログ
ラムの制御方式において、タスク毎に独立した情報の記
憶領域を容易に確保でき、また、従来複雑で実現が大変
困難であった前記プログラムも容易に実現できる。
As described above, according to the task control method of the present invention, it is possible to easily secure an independent information storage area for each task in the control method of a program which exists only in the storage area and is executed sequentially. Further, the above-mentioned program, which has been complicated and difficult to realize in the past, can be easily realized.

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

【図1】本発明のタスク制御方式の一実施例のメモリマ
ップである。
FIG. 1 is a memory map of an embodiment of a task control system of the present invention.

【図2】本実施例のタスク制御方式における動作の一例
を示す流れ図である。
FIG. 2 is a flowchart showing an example of an operation in the task control system of this embodiment.

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

11 プログラム 12 共通メモリ 13,19 タスクメモリ 14,17 タスクスタック 15 実行タスクメモリアドレス 16,18 退避タスクメモリアドレス 11 program 12 common memory 13,19 task memory 14,17 task stack 15 execution task memory address 16,18 save task memory address

Claims (1)

【特許請求の範囲】[Claims] 【請求項1】 記憶領域内に唯一存在するプログラム
と、前記プログラムが実行時にタスクに共通なプログラ
ム制御情報を格納する共通メモリと、任意のタスクによ
る前記プログラム実行時に、前記プログラムによって任
意にアドレスを割り付けてタスク毎に制御情報を格納す
るタスクメモリと、前記プログラムが前記タスクメモリ
のアドレスを格納する、前記共通メモリに存在する実行
タスクメモリアドレスと、タスクが起動される時に自動
的にアドレス割り付けされ、タスク実行に際し一時的な
プログラム制御情報を格納するタスクスタックと、タス
クが切り換えられた際に、それまで実行していたタスク
の前記実行タスクメモリアドレスを前記プログラムが格
納する、タスクスタックに存在する退避タスクメモリア
ドレス、とを備えることを特徴とするタスク制御方式。
1. A program uniquely present in a storage area, a common memory for storing program control information common to a task when the program is executed, and an address arbitrarily specified by the program when the program is executed by an arbitrary task. A task memory that allocates and stores control information for each task, an execution task memory address that exists in the common memory where the program stores the address of the task memory, and an address that is automatically allocated when the task is activated. Exists in the task stack that stores temporary program control information during task execution, and the program stores the execution task memory address of the task that was being executed when the task was switched. Saved task memory address, and A task control method characterized by and.
JP4217597A 1992-08-17 1992-08-17 Task control system Pending JPH0667898A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP4217597A JPH0667898A (en) 1992-08-17 1992-08-17 Task control system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP4217597A JPH0667898A (en) 1992-08-17 1992-08-17 Task control system

Publications (1)

Publication Number Publication Date
JPH0667898A true JPH0667898A (en) 1994-03-11

Family

ID=16706793

Family Applications (1)

Application Number Title Priority Date Filing Date
JP4217597A Pending JPH0667898A (en) 1992-08-17 1992-08-17 Task control system

Country Status (1)

Country Link
JP (1) JPH0667898A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2000056982A (en) * 1998-05-04 2000-02-25 Internatl Business Mach Corp <Ibm> Method and device for generating object in nonsustaining memory and method for maintaining possibility of access to object
JP2007122421A (en) * 2005-10-28 2007-05-17 Matsushita Electric Ind Co Ltd Memory management method

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2000056982A (en) * 1998-05-04 2000-02-25 Internatl Business Mach Corp <Ibm> Method and device for generating object in nonsustaining memory and method for maintaining possibility of access to object
US6772171B1 (en) 1998-05-04 2004-08-03 International Business Machines Corporation Method and device for creating an object in a non-persistent memory and/or keeping accessibility to said object
JP2007122421A (en) * 2005-10-28 2007-05-17 Matsushita Electric Ind Co Ltd Memory management method

Similar Documents

Publication Publication Date Title
JPH06250928A (en) Information processor
JPH08115290A (en) Data transfer device
JPH0667898A (en) Task control system
JPWO2008114415A1 (en) Multi-processing system
JPH0798663A (en) Asynchronous i/o control system
JPH10232819A (en) Memory controller and memory access method
JPH02270032A (en) Loading system
JPH02257249A (en) Information processing system
JP2985244B2 (en) Information processing device
JPH09245006A (en) Execution device and execution method for job in tightly coupled multiprocessor system
JPH05113888A (en) Microprocessor unit
JPS63208945A (en) Information processor
JPS63155338A (en) Control system for record of program executing history
JPH04365136A (en) Vector data processor
JPH04107634A (en) Memory data bypass control system
JPS6180336A (en) Testing method of program
JPS61165151A (en) Memory controlling system of data processor
JPS59114622A (en) Initial microprogram loading system
JPH0316652B2 (en)
JPH0425961A (en) Shared data update system
JPS63197239A (en) Saving/storing system for control information of virtual processor
JPH03158943A (en) Buffer storage/transfer system
JPH04273376A (en) Vector data processor
JPS6380332A (en) Microprocessor
JPH04152442A (en) Firmware device

Legal Events

Date Code Title Description
A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 19990413