HP-UX SNAplus2 NOF Programmer's Guide

Writing NOF Applications
Scheduling Asynchronous Events
Chapter 2 101
Multithreaded Applications
SNAplus2 API libraries are available for linking with multithreaded
applications. When you develop applications to operate in a
multithreaded environment, the following restrictions apply:
When an application uses the asynchronous entry point, the
application is required to maintain the consistency of its data
structures when callbacks are invoked. Consistency of data
structures can be maintained using the multithreading lock or
mutex facilities. The callbacks are made in the context of a separate
thread created and managed from within the SNAplus2 API library.
Since asynchronous callbacks run using a separate thread, the
application is not required to provide a source of scheduling to enable
the callbacks. Do not use application scheduling mode in a
multithreaded application.
The application must perform any required cleanup processing (for
example, issuing UNREGISTER_INDICATION_SINK and issuing
DISCONNECT_NODE or CLOSE_FILE)before a thread terminates.
The NOF library does not maintain any correlation between threads
and NOF verb usage and does not perform this processing
automatically when a thread terminates.
For the HP-UX 10.20 operating system, kernel threads are not
supported.
Back Level Applications
New applications will use dynamic libraries in /opt/sna/lib/hpux32 or
/opt/sna/lib/hpux64. SNAplus2 release 6.2 also includes a set of
dynamic libraries to support existing applications that have been built
with previous version of SNAplus2 on PA-Risc. These libraries are on
/opt/sna/lib or /opt/sna/lib/pa20_64. There are multiple copies of
some libraries to support different levels of the interfaces.
Motif Applications
Applications that use the Motif interface and whose code consists mainly
of callbacks from the Motif libraries are required to add SNA events to
the main Xt library scheduling loop. The SNA events allow the
SNAplus2 library to run callbacks in order to process asynchronous verb
completions.