22.09.2013 Views

NetCOBOL for SPARC Architecture SAF Subroutines User's Guide

NetCOBOL for SPARC Architecture SAF Subroutines User's Guide

NetCOBOL for SPARC Architecture SAF Subroutines User's Guide

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Compilation Method<br />

Appendix D. CGI To <strong>SAF</strong> <strong>Subroutines</strong> Conversion <strong>Guide</strong> 119<br />

It is necessary to set the compilation option THREAD (MULTI) <strong>for</strong> creating multithread<br />

objects.<br />

Accessing Common Resources<br />

A CGI application runs as one execution thread (single thread) in a dedicated process<br />

of the CGI application itself. Thus, there are no resources shared by several threads<br />

in a single process.<br />

A <strong>SAF</strong> application runs as several threads (multi-threads) within the process of NES<br />

itself. There<strong>for</strong>e, several threads may share resources.<br />

It is necessary to control synchronization in order to prevent competition when <strong>SAF</strong><br />

applications share common resources. Two types of synchronization controls are<br />

available <strong>for</strong> resource sharing: Automatic synchronization control by the COBOL runtime<br />

system, and synchronization control conducted by the <strong>SAF</strong> application itself<br />

using the "thread synchronization control subroutine" supplied by COBOL.<br />

For details, refer to the following sections in Chapter 24, Multithread Programs in the<br />

"<strong>NetCOBOL</strong> User’s <strong>Guide</strong>."<br />

• Resource Sharing among Threads<br />

• Thread Synchronization Control Subroutine<br />

Server Interface Area<br />

Users of CGI applications need not pay particular attention to the interface with the<br />

WWW server, with the exception of the environment variables. An <strong>SAF</strong> application is<br />

called by the <strong>NetCOBOL</strong> <strong>SAF</strong> director initiated by NES and receives an interface<br />

(parameter) area <strong>for</strong> transferring data with the <strong>NetCOBOL</strong> <strong>SAF</strong> director. Thus, it is<br />

necessary to modify the LINKAGE SECTION and PROCEDURE DIVISION when<br />

changing a CGI application into a <strong>SAF</strong> application. In addition, it is necessary to set<br />

the address of the interface area into COBW3, which is the interface with <strong>SAF</strong><br />

subroutines. For example:<br />

Contents of the CGI application<br />

WORKING-STORAGE SECTION.<br />

COPY COBW3.<br />

PROCEDURE DIVISION.<br />

MOVE LOW-VALUE TO COBW3.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!