ContentsIndexPreviousNext

SHARED_CODE*

For many UNIX machines, ACUCOBOL-GT supports the ability to have multiple users share the same copy of a COBOL program's object code in memory. This variable indicates which programs you want to share code. Use of shared memory is recommended only if you have a problem with limited memory and excessive swapping. In this case, the advantage of reduced swapping usually more than makes up for the overhead added by sharing memory. To use shared code for all of your programs on UNIX, add the following line:

SHARED_CODE   1

This causes all programs to attempt to share code. Every code segment loaded into memory is placed into shared memory until shared memory is full. Further code segments are then placed in conventional memory.

Since shared memory is a limited resource under UNIX, you should probably restrict the use of shared code to those programs where it is most beneficial. This ensures that other programs do not use up all of the available shared memory first. To do this, specify each program you want to share as follows:

SHARED_CODE  Program1
SHARED_CODE  Program2
SHARED_CODE  Program3

When you use this method, "Program1", "Program2", and so forth are the PROGRAM-IDs from the programs' Identification Divisions (note that a program's object file name is not used). If you use this method, then setting SHARED_CODE to "1" has no effect.