High Availability Monitors Version A.03.02 Release Notes
Writing NOF Applications
Scheduling Asynchronous Events
Chapter 2102
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.
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.
Add the following lines to your code before the first call into any SNA
library:
#include <Xt.h>
int app_context;
...
XtAppInitialize(app_context...)
...
SNA_USE_XT_SCHED(app_context);
The SNA_USE_XT_SCHED call has no return values. It calls the