Order of linking
Multithreaded applications must link the Threads Library in such a way that
it is initialized
before
all of the networking libraries.
(However, if a single-threaded application links the Threads Library solely
in order to access the synchronization primitives for inter-process
synchronization, then it should make sure that the Threads Library is
initialized
after
all of the networking libraries.)
For example, in order for your multithreaded
XTI
application to operate correctly,
you should ensure that one of the following
scenarios occurs:
-
On the
cc
line the option
-Kthread
appears
before
any files to be compiled or linked.
This option ensures that the preprocessor token
_REENTRANT
is defined
before
any source files are processed and that
libthread
is linked
after
and initialized
before
all of the libraries listed on the
cc
line.
-
The application is linked with the Threads Library at link time but
linked with the Networking Services Library at run-time (via
dlopen).
-
The application is linked first with the Threads Library and then with
the Networking Services Library (via dlopen).
© 2004 The SCO Group, Inc. All rights reserved.
UnixWare 7 Release 7.1.4 - 27 April 2004