How to build RSA ACE/Server Authentication API application with correct thread library on Sun Solaris
2 years ago
Originally Published: 2004-10-04
Article Number
000058151
Applies To
Sun Solaris 2.8
Sun Solaris 2.9
RSA ACE/Agent 5.0.3 Authentication API
Built using link flag (-lthread) as demonstrated in the SDK sample Makefile.SunOS
Issue
How to build RSA ACE/Server Authentication API application with correct thread library on Sun Solaris
In large multi-threaded applications that utilize RSA ACE/Agent Authentication API, multiple threads may interfere with each other, e.g. reading and writing the same sockets
Cause
Linking with the Sun Solaris thread library causes the RSA ACE/Agent Authentication API ACEInitialize fork() call to copy all parent process threads to the forked child process. This can cause undesirable access to the same system resources by the the parent and child process.
Resolution
Linking with -lpthread (POSIX thread library) rather than or in addition to -lthread causes the OS to utilize fork1() when an application calls fork(). fork1() copies only the calling thread to the forked child process.

Reference 'man fork' on Sun Solaris for more information.