Previous Topic: NCL Processes Competing Against OCS for the OCS Window

Next Topic: Asynchronous Panels

Competition Between NCL Processes for an NCL Environment Window

Many NCL processes can execute concurrently in an NCL processing environment. If the NCL environment is associated with a window, any process can issue &PANEL in an attempt to take over the window's presentation area to show you their particular panels.

At all times there is a logical owner for the presentation area represented by the window. For an OCS window this is OCS itself most of the time, but when an NCL process issues &PANEL it acquires logical ownership of the window and OCS operates in the background.

The same applies for other NCL processing environments. For example, the Primary Menu is initially owned by the Primary menu NCL process. If that process STARTs other NCL processes which then execute within the same NCL processing environment, these other NCL processes can bid for the window to display their own panels by issuing an &PANEL.

Once a process succeeds in becoming the (temporary) owner of a window, it can indicate its willingness to give up its ownership through the &CONTROL SHAREW option.

If the current owner of the window is executing with &CONTROL SHAREW in effect, it will automatically give up its ownership to any other process that issues &PANEL. The previous owner is then logically stacked behind the new owner. When the new owner ends or issues &PANELEND the previous owner's panel is redisplayed.

One of the most common usages of asynchronous NCL processes competing for a window is in an OCS environment. A user can have several independent NCL processes executing in the NCL processing environment associated with an OCS window. These processes might monitor the status of various items in the network and report to the operator when an error condition occurs, by issuing an &PANEL statement to takeover the window.

These processes are written to use &CONTROL NOSHAREW, preventing any other process from stealing the window from them once they displayed their panel. On acknowledgement of their panel by the operator the process issues &PANELEND to release their ownership. The window then reverts to the next waiting process or to OCS.

Note: If a panel is defined with INWAIT=0, indicating that the issuing procedure regains control immediately the panel is displayed, the system guarantees to display the panel before the issuing procedure is allowed to continue. This might mean waiting for some other process to release control of the window.