[ Previous | Next | Contents | Glossary | Home | Search ]
The graPHIGS Programming Interface: Understanding Concepts

Chapter 10. Advanced Concepts

This chapter introduces advanced concepts that are part of the graPHIGS API Version 2. These topics are based on proposed extensions to the PHIGS standard called "PHIGS+" concepts presented in this part of the book involve an organizational change that divides the graPHIGS API into two distinct parts; the graPHIGS API shell and the graPHIGS API nucleus The shell is tightly coupled to the user application and performs syntax checking and building of the graphics data stream. The nucleus, on the other hand, is tightly coupled to the resources used by a graPHIGS API application such as structure stores and workstations. A nucleus manages the resources that may be shared simultaneously by a number of application processes. Each application process is a separate thread of execution with its own shell but attached to the same nucleus. By dividing your application into multiple processes, you can distribute parts of the application to the workstation as a Distributed Application Process (DAP).

Applications written to run under Version 1 of the graPHIGS API should still run under Version 2. For a further discussion of Version 1 and Version 2 compatibility, please see Appendix B. "Compatibility"

Some of the advanced graPHIGS API capabilities include:

This chapter describes the basic concepts for controlling the various new components of the graPHIGS API products. These components are supported to satisfy the following requirements:

The following section explains how to create and manipulate graphical data on a remote workstation. It will also point out the best mechanism to support such remote data manipulation. Access to the same workstation from multiple application processes is described as well, and you will learn how to maintain the integrity and security of each resource and application process.

Following is a list of the major differences between Version 1 and Version 2 of the graPHIGS API:

  1. The graPHIGS API Version 2 is divided into two major components, a graPHIGS API shell and a graPHIGS API nucleus. An application process has only one shell, but it may be connected to one or more nuclei.
  2. The concept of central structure store is extended to multiple structure stores in a graPHIGS API nucleus. Structure stores are completely independent of each other. For example, an Execute Structure element within a structure store can only reference a structure within the same structure store. Each structure store can be shared by multiple application processes through multiple shells, and can be displayed on any workstation within the same nucleus.
  3. A workstation is not considered to be a resource directly owned by an application process but is considered to be a resource owned by a graPHIGS API nucleus which may be accessed by multiple application processes.
  4. All releases of the graPHIGS API on all levels of AIX on the RS/6000 follow the Version 2 architecture.

The graPHIGS API Environment

A typical example of the graPHIGS API environment is shown in the figure, "The graPHIGS API Environment."

Components of the graPHIGS API Environment

Within this picture, the boxes roughly represent the following components:

A system consisting of a set of hardware and an operating system on which one or more tasks can run simultaneously.
Transport Layer
The transport layer provides communication between the shell and nucleus whether it is network communication or inter-process communication. The communication methods used by the transport layer include SOCKETS, GAM, and direct subroutine calls.
A unit of software that can be individually executed on a node. Each unit may be an entire application or may be one of several cooperative processes that comprise the application.
The graPHIGS API Shell
A component of the graPHIGS API products that controls communication between an application process and one or more nuclei.
The graPHIGS API Nucleus
The main component of the graPHIGS API products that performs most of the graPHIGS API functions. One graPHIGS API nucleus can handle multiple workstations, structure stores, image boards, and font directories. A nucleus can accept requests from multiple application processes through multiple graPHIGS API shells.
The graPHIGS API Workstation
A unit consisting of one logical display surface and a set of logical input devices which may correspond to a physical terminal, a virtual terminal or a window on a physical/virtual terminal.
Structure Store
A storage unit corresponding to the central structure store in the Version 1 graPHIGS API products. There may be multiple structure stores in a graPHIGS API nucleus. Structures in a structure store within a given nucleus can be displayed on any of the graPHIGS API workstations that are controlled by the same nucleus.
Font Directory
A font directory is a repository for application fonts that reside in the memory accessible to a nucleus.
Image Board
An image board is a nucleus resource that allows your application to store and display image data.

Resources of the Nucleus

As described above, structure stores, workstations, image boards, and font directories reside in a graPHIGS API nucleus and can be shared by multiple application processes, through multiple shells. Therefore, they are called resources of the graPHIGS API nucleus.

Within a nucleus, each resource is identified and referenced by a tag called a resource identifier A resource identifier is not the same as the identifier used in the graPHIGS API subroutine calls, such as the workstation identifier of the Open Workstation (GPOPWS) subroutine. To be able to use any of the advanced graPHIGS API functions, the workstation identifier is assigned by the application while the resource identifier is assigned to a resource by the nucleus when the resource is created. Regardless of how many application processes connect to the nucleus or what identifiers the processes use for the resource, each resource identifier is always unique within a specific nucleus. Nucleus resources which an application process can access are considered attached to the application.

When a resource is created at the request of your application process, it is implicitly attached to your application. A resource can also be attached to the application explicitly via the Attach Resource (GPATR) subroutine. In either case, your application process can assign its own identifier to the resource. Once a resource is attached to your application and has been assigned an application identifier, it is always referred to by the application identifier. Mapping between the application identifier and a resource identifier on the nucleus is automatically performed by the graPHIGS API shell.

The graPHIGS API Shell

An application process must have a graPHIGS API shell. Issuing the Open graPHIGS (GPOPPH) subroutine creates a graPHIGS API shell.

The graPHIGS API shell is responsible for receiving the parameters of the application's subroutine calls, validating them for correct syntax and for ensuring that calls are made in the correct sequence. The shell also builds the request in a form that is expected by the nucleus. This may involve data conversion such as IBM floating-point format to IEEE floating-point formats, ASCII-to-EBCDIC, and byte-swapping. The shell is also responsible for receiving responses and events from a nucleus and performing any necessary conversions. A nucleus response is the return of information to the shell that was directly requested by the shell through a previous request to the nucleus. Events are generated independently by the nucleus for a variety of reasons and sent to the shell asynchronously. Typical types of events include input device data and errors. The shell also provides trace facilities and error logging.

To perform these functions, each shell maintains the following information:

Note that each resource has two identifiers, an identifier assigned by the application and a resource identifier assigned by a nucleus. By keeping this information, the shell can always perform mapping from an application identifier to a resource identifier assigned by a nucleus and vice versa. For almost all graPHIGS API subroutines, a resource (workstation, structure store, etc.) is referred to by its application identifier. However, when your application attaches to a resource that currently exists in a nucleus, it must use the resource's nucleus resource identifier. Use the Inquire Nucleus Resource Identifier (GPQNCR) subroutine to find the resource identifier of a resource assigned by the nucleus.

The graPHIGS API shell is terminated by the Close graPHIGS (GPCLPH) subroutine. If there are any nuclei connected to the shell, the Close graPHIGS subroutine call removes all of these connections.

Conceptually, a shell can access any nucleus on any node if there is a physical communication path between them. However, a given shell may have limitations as to which nuclei can be accessed, and which graPHIGS API subroutines are supported. Within each shell there is a graPHIGS API shell description table (PDT) and a graPHIGS API shell state list (PSL). By issuing the supported PDT and PSL inquiries, you may determine the capabilities, limitations, and state of a shell.

The graPHIGS API Nucleus

Generally speaking, a graPHIGS API nucleus exists and works independently of any graPHIGS API shell or application. A nucleus may run in a S/370, AIX, or 6090 environment and is created either through an environment-dependent mechanism outside of the graPHIGS API or when an application process tries to connect its shell to a nucleus.

A nucleus that exists in the same process is called a private nucleus. Only the shell that initiated the private nucleus may communicate with that nucleus. If a nucleus exists in a different process than the application, then that nucleus is called a remote nucleus (whether or not the nucleus resides on the same node as the application). A remote nucleus can communicate with any shell that is allowed to connect to it.

A special type of remote nucleus can exist on AIX: a child nucleus. A child nucleus is created when an application wants to connect to a private nucleus, but the nucleus has special requirements that it cannot fulfill inside the application's process (for example, not being threadable when running on a multiprocessing system or when the X Asynchronous Event Handling extension does not exist -- for example, X11R6). Only the shell that parented the child nucleus may communicate with the child nucleus.

A connection between a graPHIGS API shell and a graPHIGS API nucleus is established by the Connect to Nucleus (GPCNC) subroutine with the following parameters:

The nucleus connection methods currently supported are listed below:

Use the call method when you want your application to use a private nucleus. For applications that run on S/390 or AIX, this is the default method (for applications that do not call the Connect to Nucleus subroutine).
Use the GAM method (Graphics Access Method) when your application is in a S/390 environment and the application wants to communicate with on of the following:
Use a TCP/IP sockets connection to communicate between an application running in a S/390 or an AIX environment and a remote nucleus on AIX. If both the application process and the nucleus are on the same node, then local sockets are used. If each process is on a different mode, remote sockets are used.

The figures below describe the connection methods and corresponding connection specifications supported by the different combinations of shell/nucleus environments:

               Supported Connection Methods
                            Shell Environment
                       VM      MVS      AIX    6090
                    |       |       |       |       |
                VM  |  CALL |  N/A  |  N/A  |  N/A  |
Nucleus             |-------------------------------|
Environment         |       |       |       |       |
               MVS  |  N/A  |  CALL |  N/A  |  N/A  |
                    | GAM or| GAM or|CALL or|       |
               AIX  |SOCKETS|SOCKETS|SOCKETS|  N/A  |
                    |       |       |       |       |
              6090  |  GAM  | GAM   |  N/A  |SOCKETS|
                    Connection Specifications
                                Connection Method
                         1=CALL        2=GAM     3=SOCKETS
                    |    Null     |  Filedef   |  Nucspecx  |
                 VM | (length=0)  | (length<=8)| (length>=2)|
                    |    Null     |   DDNAME   |  Nucspecx  |
Application     MVS | (length=0)  | (length<=8)| (length>=2)|
Environment         |---------------------------------------|
                    |    Null     |    N/A     |  Nucspecx  |
                AIX | (length=0)  |            | (length>=2)|
                    |     N/A     |    N/A     |     :0     |
               6090 |             |            | (length=2) |
      N/A  Not a valid combination
      x    Nucspec is set to the following specification:
              hostname: nucleus connection number           Where:
            - hostname specifies the node id of an AIX
            - nucleus connection number specifies a
               a nucleus on the named system and is a number
               in the range of 0-255. 

You may choose to have your application call the Connect to Nucleus (GPCNC) subroutine or have the graPHIGS API make the connect as part of the defaults processing performed by the Open graPHIGS (GPOPPH) subroutine. This may be done as follows:

The most important role of the graPHIGS API nucleus is to distribute requests from graPHIGS API shells to nucleus resource handlers, and to distribute events or errors generated by nucleus resource handlers to graPHIGS API shells. For this purpose, the nucleus maintains the following information for each application process (shell) connected to the nucleus and each resource existing in the nucleus:

Similar to the resource identifier, the identifier of each shell is unique within the nucleus and assigned by the nucleus when the shell is connected to the nucleus. This shell identifier is mainly used to validate an application's access to a resource. The application does not need to know the shell identifier except when the application wants to communicate with other applications through the graPHIGS API application message facility. To determine your shell identifier assigned by the nucleus, use the Inquire Shell Identifier (GPQSH) subroutine.

The connection between a shell and nucleus is terminated explicitly by the Disconnect Nucleus (GPDNC) subroutine and implicitly by the Close graPHIGS (GPCLPH) subroutine. When the connection is destroyed, all resources in the nucleus that are attached to the shell are automatically detached from it.

As with shells, some nuclei may have limitations such as the number or type of shells to which the nucleus can be connected, the number and type of resources that can be created, and the set of functions actually supported.

Within each nucleus there is a Nucleus Description Table (NDT) and a Nucleus State List (NSL). By issuing the supported NDT and NSL inquiries, your application may determine the capabilities, limitations, and state of a nucleus.

The following two sections describe workstation and structure store resources.

Structure Store

A structure store is a repository for structures. Once a connection between your shell and nucleus is established, your application can create a number of structure stores in the nucleus, limited only by the amount of memory available to the nucleus and its maximum supported number. The graPHIGS API shell associates one or more structure stores within the same nucleus to a workstation in order to produce output on the workstation. However, only one structure store may be associated with a workstation at any one time. Associating a structure store to a workstation implicitly disassociates a structure store previously associated. Several workstations within a nucleus may be associated to the same structure store. Your application program is responsible for managing structure names among the structure stores that it owns.

The Create Structure Store (GPCRSS) subroutine creates a structure store resource in the specified nucleus, and attaches it to the graPHIGS API shell. All structure stores are mutually independent. For example, a structure within a structure store can reference only structures within that structure store. Subroutines applied to a structure store affect only that structure store and have no side effects on other structure stores. The same structure identifier can be used in more than one structure store without conflict.

Your application can access multiple structure stores, therefore, it is important to select the desired structure store before editing. Selecting a structure store may be done implicitly when the graPHIGS API does nucleus connection processing or explicitly by your application calling the Select Structure Store (GPSSS) subroutine.

Structure stores can be created and manipulated using one of two methods. The default method, which provides compatibility between Version 1 and Version 2 of the graPHIGS API, relies on the automatic connection of a nucleus and the creation of a structure store. The structure store is also automatically selected to be the current structure store so that the following Version 1 code will continue to work:

 Open Structure (GPOPST)
 Close Structure (GPCLST)

To suppress the default creation of both a nucleus and structure store or to allow an existing application to run on a 6090, your application must specify either an Application Defaults Interface Block (ADIB) or use an External Defaults File (EDF). ADIBs and EDFs are discussed in detail in The graPHIGS Programming Interface: Technical Reference When default nucleus and structure store processing creation is suppressed, your application will take the following form:

    (specifying DEFNUC in ADIB or EDF)
 Connect Nucleus (GPCNC)
 Create Workstation (GPCRWS)
 Create Structure Store (GPCRSS) or Attach Structure Store (GPATR)
 Associate Structure Store to Workstation (GPASSW)
 Select Structure Store (GPSSS)
 Open Structure (GPOPST)
 (Edit Structure)
 Close Structure (GPCLST)
 Close Workstation (GPCLWS)
 Close graPHIGS (GPCLPH)

In order to display the contents of a structure store on a workstation, the structure store must be associated to a workstation using the Associate Structure Store to Workstation (GPASSW) subroutine.

A structure store is automatically associated with a workstation when your application issues the Open Workstation (GPOPWS) subroutine, and a structure store is currently selected.

If your application has not selected the structure store or uses GPCRWS to create a workstation, then the structure store will not be automatically associated with the workstation. Using the Detach Resource (GPDTR) enables your application to detach a structure store from its shell. If GPDTR removes the final reference to the structure store, either through an attachment to a shell or association to a workstation, the structure store itself is released.

For each structure store within the nucleus, there is a Structure Store State List (SSL). By issuing the supported SSL inquiries, your application may determine the state of a structure store.


The Create Workstation (GPCRWS) subroutine creates a workstation resource owned by a graPHIGS API nucleus and attaches the workstation to the graPHIGS API shell. GPCRWS requires the following parameters:

The GPCRWS subroutine replaces the Open Workstation (GPOPWS) subroutine and enables your application to specify on which nucleus the workstation is to be opened. It also enables your application to specify options for the workstation that were previously specified through the External Default File (EDF) or Application Default Interface Block (ADIB).

Using the GPOPWS subroutine creates a workstation resource on a nucleus with identifier 1.

A workstation can display graphical data from any structure store existing in the nucleus where the workstation resides. In order to specify which structure store is used for display, use the Associate Structure Store with Workstation (GPASSW) subroutine. A workstation can display graphical data within one structure store only. All display subroutines, such as Associate Root with View (GPARV) subroutine, are treated as referring to a structure within the structure store associated with a particular workstation.

Your application can detach a workstation from the graPHIGS API shell using the Detach Resource (GPDTR) or Close Workstation (GPCLWS) subroutine. GPCLWS detaches the workstation resource on a nucleus with nucleus identifier 1. If this subroutine removes the final reference to the workstation, the workstation and all its resources are removed from the nucleus.

For each workstation within the nucleus, there are two Workstation Description Tables (WDT) and a Workstation State List (WSL). By issuing the supported WDT and WSL inquiries, you may determine the capabilities, limitations, and state of a workstation.

The two WDTs for each workstation are:

To obtain the most accurate information about a workstation, you should inquire its capabilities from the actual workstation description table. In order to do this you must specify the actual workstation type on the inquiry. The actual workstation type is returned by the Inquire Realized Connection and Type (GPQRCT) subroutine.

Communication between a Shell and Nucleus

Typically, you won't need to know the details of the communication mechanism used between a graPHIGS API shell and nucleus. However, to achieve the maximum performance and to fully understand topics discussed in subsequent sections, you must have a general understanding of the communication mechanism.

Data Buffering

Data transmitted between a shell and a nucleus consists of a sequence of buffered data structures called procedures Most procedures correspond to a subroutine call in the graPHIGS API and are used by the graPHIGS API to pass information between a shell and nucleus. The length of a procedure is limited by the I/O buffer size that has a maximum value of 64K bytes. The most important consequence of this limitation is that the definition data of each output primitive cannot exceed 64K bytes. For example, the number of vertices specified in a Polyline 3 primitive must be less than approximately 5,000.

A graPHIGS API shell normally allocates two 64K I/O buffers, one outbound and one inbound, for each nucleus connection. However, when you want to minimize the amount of storage used by the shell, your application can override the default I/O buffer sizes through the COMBSZ default of an Application Defaults Interface Block (ADIB) or an External Defaults File (EDF).

By default, the data created by a shell is sent to a nucleus when one of the following situations occur:

  1. When a graPHIGS API subroutine call requires modification of the content on the display surface of a workstation. The following subroutines are included in this category:
  2. When a graPHIGS API subroutine call requires data to be retrieved from the nucleus. The data may be required for the shell but not for the application itself. The following subroutines belong to this group:
  3. When the buffer becomes full.

Two mechanisms are supplied for the application to change the default action for some of these situations. One is the Set Shell Deferral State (GPSHDF) subroutine that enables the application to suppress automatic data sending caused by the subroutines within the first group of this list. This enables the application to realize an animation sequence without causing unnecessary I/O operations between the shell and nucleus. For example, a series of alternating invocations of Set View Matrix and Update Workstation can be accumulated into the I/O buffer and sent to a nucleus with a single I/O operation. The nucleus would then generate multiple frames on the display surface without I/O overhead between each frame. Another mechanism to change the default action is provided by the Synchronize (GPSYNC) subroutine that enables the application to force data transmission directly. When the application issues Synch, any buffered requests are sent to the nucleus immediately.

Data is sent from a nucleus to a shell in the following situations:

  1. When a request from a shell requires a response
  2. When a request from a shell cannot be processed for some reason (an error will be generated)
  3. When another application process requests an application message to be sent to a target application (shell)
  4. When a component of the nucleus encounters an asynchronous error related to a resource attached to the shell
  5. When an input device which has been activated by the shell generates an input device event
  6. When certain situations generate events (that is, storage threshold has been reached or synchronous workstation updates have completed).
Unlike the data sent from a shell to a nucleus, the data from a nucleus to a shell will conceptually be transmitted as it is created. When more than one request from a shell is sent in a single I/O operation and there is more than one response or error related to these requests, the latter may also be buffered to increase I/O performance. However, such buffering is not visible to the application.

Resource Access Serialization

A nucleus can receive requests from multiple shells at any time and is only required to guarantee the following:

There is no assurance that requests coming from multiple shells are processed in the global order of their creation. Therefore, when multiple shells share the same nucleus resource, special care must be taken to prevent the shells from ending up in a deadlock situation where both shells are waiting for the other shell to free up a resource.
Workstation Serialization

When a workstation is shared by multiple shells, usage of the workstation's input devices is serialized as follows:

  1. When an input device is activated by an application process the device is dedicated to that process until the device is deactivated by the process or by an operator's action. An input device dedicated to a process cannot be accessed by any other process.
  2. When an input device is set to Event or Request mode, only the application process that activated the device is given the input data.

    Likewise, when an input device is set to Request mode, only the application process that activated the device is notified when a break action occurs.

  3. When the device is set to Sample mode, any application process can sample the device.
Structure Store Serialization

When a structure store is shared by multiple application processes, access to the structure store is also treated in a special manner. When an application process calls the Open Structure (GPOPST) subroutine, the currently selected structure store is dedicated to that application process. All subsequent structure modification requests from other application processes are not processed and are blocked by the nucleus, until the 'owning' application process calls the Close Structure (GPCLST) subroutine.

Notice that the structure store state described here is different from the structure state of the graPHIGS API shell. The structure state of the shell is mainly used to check whether an application process issues graPHIGS API calls in the correct sequence or not. For example, any output primitive subroutines will only be processed if the structure is opened to make sure these primitives are correctly stored in a structure. The purpose of the structure store state in the nucleus is not for validity checking but for ensuring that structure editing operations are consistent between application processes. For example, the Delete Structure (GPDLST) subroutine deletes not only the specified structure but also all references to the structure. If your application issues this subroutine call while another application process has a structure open, this automatic deletion of structure references (Execute Structure elements) can cause many problems.

All requests to a structure store that are blocked by this mechanism are not discarded but processed at a later time. There is no assurance that these blocked requests are processed immediately after the current owner issues a Close Structure. If the previous owner issues another Open Structure request, the structure store may be dedicated to the same application process again. Switching between requests from different application processes is not guaranteed to be performed in any particular order.

Font Directory Serialization

When a font directory is shared by multiple application processes, access to the font directory is treated in a special manner. When an application process calls the Load Font (GPLDFO) subroutine to load a font into the directory, the specified font directory is dedicated to that application process. All subsequent requests from other processes to access the font directory are blocked by the nucleus until the the load of the font completes. When the load of the font completes, the font directory may then be accessed by other application processes.

Serialization of Image Boards

When an image board is shared by multiple application processes, access to the image board is also treated in a special manner. When an application process calls the Write Rectangle (GPWRCT) subroutine, requests from other processes to access the image board are blocked by the nucleus until the write to the image board completes. When the write to the image completes, the image board may be accessed by other application processes.

Distributed Application Processes (DAPs)

The graPHIGS API gives you the ability to divide your application into multiple Distributed Application Processes (DAPs). Each DAP is a separate executable graPHIGS API process with its own graPHIGS API shell. These DAPS are downloaded to the remote nucleus by a connected shell process, using the Initiate Application Process (GPINAP) subroutine or the Execute Application Process (GPEXAP) subroutine. A DAP that already exists on the node containing the remote nucleus can be executed by using GPINAP or GPEXAP. The use of DAPS allows you to offload some functions that cannot be performed efficiently across a network.

A DAP can perform many diverse functions, including:

On a 6090, DAPs are limited by the amount of memory available and the fact that disk files are not available. The memory in a 6090 is shared by other components, such as the graPHIGS API nucleus, operating system, and other DAPS. Therefore, only those functions that can be performed faster in the 6090 Graphics System by eliminating the communications overhead with the host, should be performed with DAPS that run on a 6090.

On an AIX system, a DAP has the same privileges and restrictions as any other application on the system, as shown in the figure, "DAP Organization."

For a discussion of compiling, starting, and terminating DAPs, see The graPHIGS Programming Interface: Writing Applications

One method for two application processes to communicate is through the application message facilities provided by the graPHIGS API as discussed in the following section.

Communication between Multiple Application Processes

In order for multiple application processes to communicate, the graPHIGS API provides a message facility used to send application defined messages from one application process to the event queue of another process. The messages are sent using the Send Broadcast Message (GPSBMS) and Send Private Message (GPSPMS) subroutines and can be retrieved from the event queue by the target process using the Get Message (GPGTMS) subroutine.

The format of the message event is defined by the graPHIGS API, but there is no restriction on the contents of the application message. The graPHIGS API shell and nucleus do not perform any validity checking or implicit conversion on the message data and no additional information, such as the originator of the message, is supplied in the message event. The graPHIGS APIthat performs the following conversions:

GPCVD performs the conversions based on the environment your application is running in and the target environment specified as a parameter to GPCVD With GPCVD, one application process can convert data to a form recognized by the target environment or by its own environment. The data can be in the form of either a character string, integer array, floating-point array, or data record.

In order to prevent an application process from receiving unexpected messages sent by unknown applications, the following two levels of protection are provided.

  1. When a shell is connected to a nucleus, the nucleus assigns the shell an identifier known only to the application which owns the shell. The identifier is called a shell identifier and can be retrieved through the Inquire Shell Identifier (GPQSH) subroutine.
  2. Each application process can set a message password for its shell using the Set Message Password (GPMSPW) subroutine. As with passwords of resources, the message password can take one of the following values:
    No application messages are received.
    All application messages are received.
    Only the application message sent with the matching password are received.
The message password of a shell is set to 0=NONE when a shell and nucleus are connected and can be set to another value using the GPMSPW subroutine.

The Send Private Message (GPSPMS) subroutine has the following parameters:

This message is sent to the target shell only when the shell has message password ALL, or when the specified message password matches with that of the target shell.

Because the broadcast message has no specific target, the application need not specify any shell identifier or message password. The broadcast message is sent to all shells attached to the specified nucleus which have their shell password ALL. The Send Broadcast Message (GPSBMS) subroutine has the following parameters:

A typical scenario for two applications processes to share a resource by using the application messages is presented below. The resource being shared is a structure store created by the first application process.

Each process can now edit structures within the same structure store.

Resource Sharing

One application process can attach a nucleus resource (a workstation, structure store, image board, or font directory) created by another application process to its process by using the Attach Resource (GPATR) subroutine with the following parameters:

The resource type parameter must indicate one of the following resources:

To be able to attach a resource, your application must know the resource's nucleus resource identifier and password. Initially, this information is known only to the application process that created the resource. The nucleus resource identifier is assigned by the nucleus when the resource is created and can be retrieved using the Inquire Nucleus Resource Identifier (GPQNCR) subroutine.

The password of each resource can have one of the following values:

Only the application that created the resource can access it
Any application can access (attach) the resource
Any application with the correct password can access(attach) the resource.

Each time a resource is created in a nucleus, the resource's password is set to 0=NONE so it cannot be shared by any other application process. Therefore, when two or more application processes want to share a resource, its password must be explicitly set to some value other than zero by the Set Password (GPPW) subroutine. For security reasons, this subroutine allows only the application process that created the resource to change its password.

A scenario for two application processes to share a resource follows:

The resource is being shared by the 2 application processes.

User Exits and Conferencing

The graPHIGS API supports user exits and provides subroutines that can work in conjunction with a conference utility. Although the software required in a conference utility is considerable in size, the benefits can be great. Designers collaborating from remote sites can view the same model simultaneously, with each workstation able to interact with the application. New users of the graPHIGS API also benefit when getting assistance from the help desk through a conference utility. The following graPHIGS API subroutines are available for use with a conference utility.

Refer to The graPHIGS Programming Interface: Technical Reference for more information about user exits and a description of a typical conference utility.

[ Previous | Next | Contents | Glossary | Home | Search ]