|
|
|
|
This section summarizes the information you need to consider when developing TPs for use in the Solaris environment.
If the process that issued TP_STARTED or RECEIVE_ALLOCATE then forks to create a child process, the child process cannot use the tp_id that was returned to the parent process. It can, however, issue its own TP_STARTED or RECEIVE_ALLOCATE to obtain its own tp_id.
Two or more instances of the same TP can run as different processes, but each instance is assigned its own tp_id.
You can write an application in which one process contains many TPs,
each with its own tp_id. However, you need to design
the application carefully to avoid deadlock
situations, in
which an APPC verb cannot complete because of the state of other conversations
and TPs in the same process. This might happen if the program is waiting on
one conversation for information to be sent to it before returning some other
data, and another conversation from the same process is waiting for this data
before it can send the information originally required by the first conversation.
To some extent this can be avoided by using a separate process for each TP.
Applications are compiled with different options in order to select one of the scheduling modes described in Scheduling Asynchronous Events.
Applications linked with previous versions of SNAP-IX that used signal-based scheduling mode and the single-threaded library, libmgr.so, will continue to work in the current version of SNAP-IX. However, this library is provided only for back-compatibility. New applications should not use this library.
When compiling your APPC application, use the following options:
Indicates the directory containing one or more header files your application requires.
Specifies use of the sparcv9 (64-bit) architecture instruction set. Use this option if you want to compile the application in 64-bit mode. To compile in 32-bit mode, do not specify this option.
When linking your APPC application, use the following options:
Specifies use of the sparcv9 (64-bit) architecture instruction set. Use this option if you want to link the application in 64-bit mode. To link in 32-bit mode, do not specify this option.
Indicates the directory containing one or more libraries to be used when linking the application.
This directory is normally /opt/sna/lib, except for 64-bit applications where it is /opt/sna/lib/sparcv9.
Indicates the name of a library to be used when linking the application.
Indicates the directory containing one or more libraries to be used by the application at run time. This directory is normally /opt/sna/lib, except for 64-bit applications where it is /opt/sna/lib/sparcv9 .
As an alternative to the option, you can set the
environment variable
Indicates a preprocessor directive to be used by the compiler. Do not include any space between and the name of the preprocessor directive.
The command you use to link the application depends on which type of application it is, as described below.
For a 64-bit application, link with the following options:
-xarch=v9 -L /opt/sna/lib/sparcv9 -R /opt/sna/lib/sparcv9 -lappc -lsna
For a 32-bit application, link with the following options:
-L /opt/sna/lib -R /opt/sna/lib -lappc -lsna
If you are using the standard Solaris compiler /usr/ucb/cc, you may encounter compiler errors indicating that the library libucb.so.1 could not be found. If this occurs, add /usr/ucblib to the compiler options you use to link the program.
Check your Motif documentation for information on which libraries and other options are required to link your Motif application.
For Solaris, a multithreaded application can use either Solaris threads or POSIX threads. Refer to the Solaris Programmer's Guide for multithreaded programs for more information on using each type of threads. The following options are suitable for linking most applications:
-D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS -L /opt/sna/lib -R /opt/sna/lib -lappc -lsna_r -lthread
For a 64-bit application, link with the following options:
-xarch=v9 -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS -L /opt/sna/lib/sparcv9 -R /opt/sna/lib/sparcv9 -lappc -lsna_r -lthread
If you are using the standard Solaris compiler /usr/ucb/cc , you may encounter compiler errors indicating that the library libucb.so.1 could not be found. If this occurs, add /usr/ucblib to the compiler options you use to link the program.
|
|
|
|
|