HP-UX SNAplus2 CPI-C Programmer's Guide (June 2003)
Writing CPI-C Applications
HP-UX Considerations
Chapter 2 95
HP-UX Considerations
For Unix This section summarizes the information you need to consider when
writing CPI-C applications for HP-UX systems. This includes
applications that:
• Are single-threaded
• Are multithreaded
• Use multiple processes
If you are writing Java CPI-C applications, see “Java CPI-C
Considerations”.
CPI-C Header File
The header file to be used with CPI-C applications is
/usr/include/sna/cmc.h. This file contains the definitions of all CPI-C
entry points. It also includes the common interface header file
/usr/include/sna/values_c.h; these two files contain all the
constants defined for supplied and returned parameter values at the
CPI-C interface.
Single-Threaded Applications
Single-threaded applications are based around a single main thread of
execution to receive and process requests. If such applications use only
blocking mode, as described in “Set_Processing_Mode (cmspm)”, there
are no special considerations. However to make the most effective use of
nonblocking mode, the application must be coded appropriately.
To schedule asynchronous events, single-threaded applications use the
application scheduling mode or the signal-based scheduling mode.
• Application scheduling mode gives the application full control over
event scheduling from different sources by integrating SNA
callbacks with the application's main processing loop. It is the
recommended technique for new applications.