Deprecated: The each() function is deprecated. This message will be suppressed on further calls in /home/zhenxiangba/zhenxiangba.com/public_html/phproxy-improved-master/index.php on line 456
JPH0452491B2 - - Google Patents
[go: Go Back, main page]

JPH0452491B2 - - Google Patents

Info

Publication number
JPH0452491B2
JPH0452491B2 JP58056703A JP5670383A JPH0452491B2 JP H0452491 B2 JPH0452491 B2 JP H0452491B2 JP 58056703 A JP58056703 A JP 58056703A JP 5670383 A JP5670383 A JP 5670383A JP H0452491 B2 JPH0452491 B2 JP H0452491B2
Authority
JP
Japan
Prior art keywords
program
work area
reentrant
pool
programs
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.)
Expired - Lifetime
Application number
JP58056703A
Other languages
Japanese (ja)
Other versions
JPS59180744A (en
Inventor
Takanobu Fujimoto
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 JP58056703A priority Critical patent/JPS59180744A/en
Publication of JPS59180744A publication Critical patent/JPS59180744A/en
Publication of JPH0452491B2 publication Critical patent/JPH0452491B2/ja
Granted legal-status Critical Current

Links

Landscapes

  • Devices For Executing Special Programs (AREA)
  • Memory System (AREA)
  • Executing Machine-Instructions (AREA)

Description

【発明の詳細な説明】 〔発明の技術分野〕 本発明は、リエントラントプログラムの作業領
域管理方式に関し、特にGETMAIN/
FREEMAINマクロ命令を用いることなしに、必
要な作業域を未使用域から容易に確保し管理する
ことができる作業領域管理方式に関する。
DETAILED DESCRIPTION OF THE INVENTION [Technical Field of the Invention] The present invention relates to a work area management method for a reentrant program, and in particular to a GETMAIN/
This invention relates to a work area management method that can easily secure and manage a necessary work area from an unused area without using the FREEMAIN macro command.

〔技術の背景〕[Technology background]

マルチプログラミングシステムあるいはマルチ
プロセツサシステムでは、関数計算など各プログ
ラムが共通に必要とする処理のサブルーチンを、
それぞれのプログラムが別々に保有した場合、主
記憶装置の利用効率が低下することから、そのよ
うなサブルーチンについては主記憶装置上に1つ
だけ置いて、各プログラムに共有させることが望
ましい。
In a multiprogramming system or multiprocessor system, subroutines for processing commonly required by each program, such as functional calculations, are
If each program holds the subroutine separately, the utilization efficiency of the main memory will decrease, so it is desirable to place only one such subroutine on the main memory and share it with each program.

しかし、共有サブルーチンは、複数のプログラ
ムにより同時並行的に使用されることがあるた
め、共有サブルーチン内の命令あるいはデータは
どのプログラムによつても書き替えられないよう
にし、かつその作業領域は、共有サブルーチンか
ら切り離して、共有サブルーチンを呼び出した各
プログラムごとに管理する必要がある。このよう
な構造のサブルーチンは、リエントラント(再入
可能)プログラムと呼ばれる。
However, since shared subroutines may be used concurrently by multiple programs, the instructions or data within the shared subroutines must not be rewritten by any program, and the work area must be shared. It is necessary to separate it from the subroutine and manage it for each program that calls the shared subroutine. A subroutine with such a structure is called a reentrant program.

リエントラントプログラムの作業領域は、呼び
出し元プログラムが確保するか、あるいはリエン
トラントプログラムが実行されるときリエントラ
ントプログラムで動的に確保する必要がある。第
1図は後者の例を示し、1,2はリエントラント
プログラムである。各リエントラントプログラム
の先頭にGETMAINマクロを置き、最後に
FREEMAINマクロを置く。GETMAINマクロ
により、スーパーバイザにリージヨン(メモリの
ユーザ域)内領域の確保を依頼し、また
FREEMAINマクロにより、先に確保した領域の
返却をスーパーバイザに依頼する。通常は、この
方法が多くとられているが、1回の依頼に数百の
命令の実行が必要となるためスーパーバイザの負
担となり、処理性能を低下させる欠点がある。
The work area of a reentrant program must be reserved by the calling program or dynamically by the reentrant program when the reentrant program is executed. FIG. 1 shows an example of the latter, and 1 and 2 are reentrant programs. Put a GETMAIN macro at the beginning of each reentrant program and at the end
Place the FREEMAIN macro. The GETMAIN macro requests the supervisor to secure an area within the region (user area of memory), and also
Use the FREEMAIN macro to request the supervisor to return the previously secured area. Although this method is usually used, it has the drawback that it requires the execution of several hundred instructions for one request, which places a burden on the supervisor and reduces processing performance.

また、リエントラントプログラム自体の将来の
性能向上を考慮して、予め十分な大きさの領域を
GETMAINマクロで確保しておき、実行時に、
その中から必要なスペースを自前で確保する方法
がある。しかし、この方法では、呼び出し関係に
あるプログラム間のインタフエースが複雑にな
り、第2図に示すように、3,4で示すリエント
ラントプログラムA,Bの間に、領域管理方式が
異なる5のプログラムXが介在するようなときに
は、リエントラントプログラムA,B間の領域を
連結する領域管理が困難となるため、適用できる
プログラムに制約が生じる。
In addition, in consideration of future performance improvements of the reentrant program itself, a sufficiently large area should be created in advance.
Secure it with the GETMAIN macro, and at runtime,
There are ways to secure the necessary space yourself. However, with this method, the interface between the programs in the calling relationship becomes complicated, and as shown in FIG. When X intervenes, it becomes difficult to manage the area to connect the areas between the reentrant programs A and B, which places restrictions on the programs that can be applied.

〔発明の目的および構成〕[Object and structure of the invention]

本発明の目的は、呼び出し関係にある複数のリ
エントラントプログラムの間に領域管理方式が異
なる他のプログラムが挟まれている場合にも、ス
ーパーバイザに依存することなく、自前でかつ簡
単な手段で作業領域の確保を行なうことが可能な
リエントラントプログラムの作業領域管理方式を
提供することにある。
An object of the present invention is to manage a work area independently and easily, without depending on a supervisor, even when other programs with different area management methods are sandwiched between a plurality of reentrant programs in a calling relationship. An object of the present invention is to provide a work area management method for a reentrant program that can ensure the following.

そして、本発明はそのための構成として、リエ
ントラントプログラムを含む複数のプログラムが
多重の呼び出し関係で結合されているシステムに
おいて、最初のリエントラントプログラムが実行
されるとき、自身および後続のプログラムのため
の十分な作業領域プールを確保し、かつ該作業領
域プールの先頭位置情報を含む制御表を作成する
とともに、上記作業領域プールの所定の位置に空
き領域情報を格納し、上記制御表は、順次1つの
プログラムから呼び出された次のプログラムに制
御が渡されるとき同時に引き渡され、各呼び出さ
れたプログラムがリエントラントプログラムであ
るとき、該制御表から作業領域プールの位置情報
を得て、該プール内に格納されている空き領域情
報にもとづいて必要な作業領域を確保しかつ空き
領域情報を更新し、そして上記作業領域プール内
に作業領域を確保したプログラムが処理を終了し
たとき、該作業領域を返却するとともに空き領域
情報を復元することを特徴としている。
To this end, the present invention has a configuration in which, in a system in which a plurality of programs including reentrant programs are connected in a multiple call relationship, when the first reentrant program is executed, there is sufficient memory for itself and subsequent programs. A work area pool is secured, a control table containing information on the start position of the work area pool is created, and free space information is stored in a predetermined position of the work area pool, and the control table is sequentially created by one program. When control is passed to the next program called from the program, when each called program is a reentrant program, the position information of the work area pool is obtained from the control table and stored in the pool. The program secures the necessary work area based on the free space information in the work area pool, updates the free space information, and when the program that has secured the work area in the work area pool completes its processing, returns the work area and updates the free space information. It is characterized by restoring area information.

〔発明の実施例〕[Embodiments of the invention]

以下に、本発明の詳細を実施例にしたがつて説
明する。
The details of the present invention will be explained below with reference to Examples.

第3図は、第2図と同じプログラム例について
本発明を適用したものである。図中3,4は、そ
れぞれリエントラントプログラムA,B、5は領
域管理方式が異なるプログラムX、6はスーパー
バイザ、7は作業領域プール、8は制御表Tを示
す。最初にリエントラントプログラムAが、実行
開始時にGETMAINマクロにより十分大きな作
業領域プール7を確保する。このとき作業領域を
管理する制御表Tが作成される。制御表Tは、確
保されている作業領域プールを指すポインタを含
んでいる。
FIG. 3 shows the same program example as in FIG. 2 to which the present invention is applied. In the figure, 3 and 4 are reentrant programs A and B, respectively, 5 is a program X with a different area management system, 6 is a supervisor, 7 is a work area pool, and 8 is a control table T. First, reentrant program A secures a sufficiently large work area pool 7 using the GETMAIN macro when starting execution. At this time, a control table T for managing the work area is created. Control table T contains pointers pointing to reserved work area pools.

リエントラントプログラムAから、たとえば非
リエントラントプログラムXへ、およびプログラ
ムXからリエントラントプログラムBへ、それぞ
れ呼び出しが行なわれたとき、制御表Tが引き渡
される。この場合、プログラムXは領域管理方式
が異なるため、制御表Tは使用せずに、次のリエ
ントラントプログラムBへそのまま引き渡す。リ
エントラントプログラムBは、制御表T中のポイ
ンタから、確保されている作業領域プールを知
り、後述するように、その中から自身の作業領域
を確保する。
When a call is made from reentrant program A to, for example, non-reentrant program X, and from program X to reentrant program B, control table T is passed. In this case, since program X has a different area management system, control table T is not used and the program is handed over to the next reentrant program B as is. The reentrant program B learns the secured work area pool from the pointer in the control table T, and secures its own work area therein as will be described later.

なお、プログラム間で制御表を引き渡す場合、
一般に用いられる手法であるところのプログラム
呼出しのパラメタの形態で行うのが最も簡単な方
法であるが、ジヨブ空間の特定の場所に制御表の
アドレスを設定する方法などの他の慣用されてい
る手法も利用することができる。
Note that when passing control tables between programs,
The easiest way to do this is in the form of parameters in the program call, which is a commonly used technique, but other commonly used techniques such as setting the address of a control table at a specific location in job space are possible. can also be used.

第4図は、作業領域の管理方法の1例を示した
ものであり、図中、7は作業領域プール、8は制
御表T、9はプログラムXの作業領域を示す。
FIG. 4 shows an example of a work area management method. In the figure, 7 shows a work area pool, 8 shows a control table T, and 9 shows a program X work area.

制御表Tによりポインタされた作業領域プール
7の先頭アドレスには、作業領域プール7の最終
アドレスP1が格納され、次のアドレスには空き
領域の先頭アドレスP2が格納されている。
The first address of the work area pool 7 pointed to by the control table T stores the final address P1 of the work area pool 7, and the next address stores the first address P2 of the free area.

P1,P2の設定は、各リエントラントプログラ
ムA,Bにより行なわれ、プログラム中にはその
ための記述を含んでいる。たとえばリエントラン
トプログラムBは、制御表Tから作業領域プール
7の先頭アドレスを求め、P1,P2からプール中
の空き領域の大きさをチエツクし、その中に自身
の作業領域を設定し、P2を新しい空き領域の先
頭アドレスP′2で更新する。
Setting of P 1 and P 2 is performed by each reentrant program A and B, and the program includes a description therefor. For example, reentrant program B obtains the start address of the work area pool 7 from the control table T, checks the size of the free area in the pool from P 1 and P 2 , sets its own work area therein, and 2 is updated with the start address P′ 2 of the new free area.

リエントラントプログラムBは処理を終了する
と、作業領域を返却し、P′2をP2に復元し、プロ
グラムXに実行権を戻す。プログラムXが処理を
終了するとリエントラントプログラムAに実行権
を戻す。リエントラントプログラムAは、処理の
終りにFREEMAINマクロを実行し、スーパバイ
ザ6に、作業領域プール7および制御表8の返却
処理を依頼する。
When reentrant program B completes its processing, it returns its work area, restores P'2 to P2 , and returns execution rights to program X. When program X completes its processing, the execution right is returned to reentrant program A. The reentrant program A executes the FREEMAIN macro at the end of processing and requests the supervisor 6 to return the work area pool 7 and control table 8.

このように、リエントラントプログラムがいく
つ続いても、各リエントラントプログラムは、最
初に確保された作業領域プールの中に自身の作業
領域を設定することができる。また順次呼び出し
たプログラムへ制御表を引き渡す処理を行なうた
めのプログラム記述は、たとえばプログラム呼出
しのためのパラメタ記述中で行われるが、この記
述は、コンパイル処理時にコンパイラにより各リ
エントラントプログラムに対して自動的に付加さ
れるようにすることができる。
In this way, no matter how many consecutive reentrant programs there are, each reentrant program can set its own work area in the initially reserved work area pool. In addition, the program description for passing the control table to sequentially called programs is done, for example, in the parameter description for program calling, but this description is automatically written to each reentrant program by the compiler during the compilation process. can be added to.

〔発明の効果〕〔Effect of the invention〕

以上のように本発明によれば、GETMAIN/
FREEMAINによるスーパーバイザコール
(SVC)は最初のリエントラントプログラムに限
られるため、呼び出されたリエントラントプログ
ラムからスーパバイザへのこれらのSVCに対し
て、スーパバイザは従来数百の命令の実行を必要
としたものが数十の命令の実行で済ますことが可
能となり、スーパバイザの負担は著しく軽減され
て、実行性能の向上が得られる。
As described above, according to the present invention, GETMAIN/
Supervisor calls (SVCs) due to FREEMAIN are limited to the first reentrant program, so for these SVCs from the called reentrant program to the supervisor, the supervisor has to execute only a few dozen instructions instead of hundreds. This makes it possible to execute only the following instructions, significantly reducing the burden on the supervisor and improving execution performance.

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

第1図および第2図は、それぞれ従来のリエン
トラントプログラムの作業領域を確保するための
異なる方式を示す図、第3図は本発明方式の実施
例図、第4図はその空き領域管理の説明図であ
る。 図中、3,4はリエントラントプログラム、5
は領域管理方式が異なるプログラム、6はスーパ
ーバイザ、7は作業領域プール、8は制御表を示
す。
Figures 1 and 2 are diagrams showing different methods for securing a work area for a conventional reentrant program, respectively, Figure 3 is an embodiment of the method of the present invention, and Figure 4 is an explanation of its free space management. It is a diagram. In the figure, 3 and 4 are reentrant programs, 5
are programs with different area management methods, 6 is a supervisor, 7 is a work area pool, and 8 is a control table.

Claims (1)

【特許請求の範囲】[Claims] 1 リエントラントプログラムを含む複数のプロ
グラムが多重の呼び出し関係で結合されているシ
ステムにおいて、最初のリエントラントプログラ
ムが実行されるとき、自身および後続のプログラ
ムのための十分な作業領域プールを確保し、かつ
該作業領域プールの先頭位置情報を含む制御表を
作成するとともに、上記作業領域プールの所定の
位置に空き領域情報を格納し、上記制御表は、順
次1つのプログラムから呼び出された次のプログ
ラムに制御が渡されるとき同時に引き渡され、各
呼び出されたプログラムがリエントラントプログ
ラムであるとき、該制御表から作業領域プールの
位置情報を得て、該プール内に格納されている空
き領域情報にもとづいて必要な作業領域を確保し
かつ空き領域情報を更新し、そして上記作業領域
プール内に作業領域を確保したプログラムが処理
を終了したとき、該作業領域を返却するとともに
空き領域情報を復元することを特徴とするリエン
トラントプログラムの作業領域管理方式。
1. In a system in which multiple programs including reentrant programs are linked in a multiple call relationship, when the first reentrant program is executed, it must ensure a sufficient work area pool for itself and subsequent programs, and A control table containing information on the start position of the work area pool is created, and free space information is stored at a predetermined position in the work area pool, and the control table is used to control the next program called from one program in sequence. is passed at the same time, and when each called program is a reentrant program, it obtains the location information of the work space pool from the control table and calculates the required space based on the free space information stored in the pool. It is characterized by securing a work area, updating free space information, and returning the work area and restoring the free space information when the program that has secured the work area in the work area pool completes processing. A work area management method for reentrant programs.
JP58056703A 1983-03-31 1983-03-31 System for managing working area of reentrant program Granted JPS59180744A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP58056703A JPS59180744A (en) 1983-03-31 1983-03-31 System for managing working area of reentrant program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP58056703A JPS59180744A (en) 1983-03-31 1983-03-31 System for managing working area of reentrant program

Publications (2)

Publication Number Publication Date
JPS59180744A JPS59180744A (en) 1984-10-13
JPH0452491B2 true JPH0452491B2 (en) 1992-08-24

Family

ID=13034823

Family Applications (1)

Application Number Title Priority Date Filing Date
JP58056703A Granted JPS59180744A (en) 1983-03-31 1983-03-31 System for managing working area of reentrant program

Country Status (1)

Country Link
JP (1) JPS59180744A (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0792747B2 (en) * 1985-05-31 1995-10-09 富士通株式会社 Main memory common work area usage control method
JP4500040B2 (en) * 2003-01-06 2010-07-14 パナソニック株式会社 COMPILER PROGRAM, COMPUTER-READABLE RECORDING MEDIUM CONTAINING COMPILER PROGRAM, COMPILING METHOD, AND COMPILING DEVICE
JP6444662B2 (en) * 2014-09-03 2018-12-26 三菱重工業株式会社 Control device

Also Published As

Publication number Publication date
JPS59180744A (en) 1984-10-13

Similar Documents

Publication Publication Date Title
JP3659062B2 (en) Computer system
KR100278327B1 (en) Method and apparatus for providing shared off-screen memory
US20080005438A1 (en) Methods and Apparatuses to Maintain Multiple Execution Contexts
JPH0635732A (en) Storage device area allocation method
US20030208492A1 (en) System and method of using extensions in a data structure without interfering with applications unaware of the extensions
JPH09502558A (en) Method and system for protecting shared code and data in a multitasking operating system
JPH0452491B2 (en)
JPH04155465A (en) File sharing method
CN109376022B (en) A thread model implementation method to improve the execution efficiency of Halide language in multi-core systems
JPS603229B2 (en) Information processing method
JP3022398B2 (en) Virtual computer system
JPS6156816B2 (en)
JPH03218532A (en) Control system for arbitrary starting program
JPH0221610B2 (en)
JP2860990B2 (en) Data save / restore method for program re-execution
JPH03182945A (en) Transfer system for data in main storage
JP2926873B2 (en) Computer system
JPS6155752A (en) Control of expanded memory device
JPH04205039A (en) Exclusive control on shared files in a plurality of operating systems
JPH05265846A (en) Memory management method
JPS61160147A (en) Virtual computer control system
JPS62217326A (en) Computer capable of storing and switching plural os
JPH0754481B2 (en) Overlay control method
JPS6353650A (en) Computer
JPS58166455A (en) Relational type data base system