Questions
Answers1. Where can I find background information on: Solaris vs. POSIX threads, bound vs. unbound threads, MxN vs. 1:1?
2. What is the alternate thread library (T2) of the Solaris 8 Operating Environment (OE)?
Solaris 8 has a new implementation of the thread library. However, in Solaris 8 it is provided as an alternate thread (T2) library. The path of the T2 library is 3. What is the main difference between the default thread library and the T2 library? The main difference between the two thread libraries is the architecture of implementation. The default threads library implementation is a two-level model in which user-level threads are multiplexed over possibly fewer lightweight processes, or LWPs. An LWP is the fundamental unit of execution that is dispatched to a processor by the operating system. This model is also known as MxN implementation. The Solaris 8 Operating Environment provides an alternate threads library implementation, a one-level model, in which user-level threads are associated one-to-one with LWPs. This model is also known as 1:1 implementation. 4. What kind of behavior difference can be expected from switching over to the T2 library? When using the alternate one-level threads library, it could create more LWPs than the default threads library using unbound threads. Each LWP requires system memory for a stack and other data structures to use while executing in the kernel -- approximately 10 Kbytes for a 32-bit operating system and 20 Kbytes for a 64-bit operating system. Running applications with many thousands of threads might require additional physical memory in the system. The T2 library avoids the overhead of multiplexing and scheduling the threads over LWP, and hence, it shows better performance compared to the default thread library of Solaris 8. However, there could be a few cases where the default thread gives better performance than the T2 library. For further information, refer to the Ping-Pong example in the white paper listed in Question 17, Multithreading in the Solaris Operating Environment. 5. What are the advantages of using T2 over the default thread library in the Solaris 8 OE? The advantages of T2 over the default thread library are expected to be as follows:
The latest SPECjbb2000 results posted by Sun for the Sun Fire 15000 with 104 processors were run using LD_LIBRARY_PATH=/usr/lib/lwp on Solaris 8 Update 7 (see SPECjbb2000). 6. Which maintenance level of Solaris 8 is recommended for use of the alternate thread library? Solaris 8 Update 7 (2/2002) release is recommended for use of the T2 library since it contains all the performance enhancements and patches. If your release level is lower than Update 7, then you can apply the maintenance update 7 patch cluster or the following patches related to T2:
(These patches can be applied from SunSolve to the installed Solaris 8 release so that the kernel level and T2 library level are updated to Solaris 8 Update 7 level.) The version of the T2 library in Solaris 8 Update 7 has been improved over older versions in previous Solaris 8 updates, with the addition of user-level sleep queues and adaptive mutex locking. It is the same as the default thread library included in the full release of Solaris 9, which is backported to Solaris 8. 7. Why not make the T2 library the default for all Solaris 8 customers via a patch? The T2 library is based on a completely different architecture. This new architecture means that it is not a fix for the existing default thread library (even though many applications run better with the T2 library). It can be considered as a backport of a future technology from Solaris 9, made available to Solaris 8 Update 7 customers as an optional implementation. Due to the change in architecture, it cannot be made the default thread library in Solaris 8 via a patch. (Note: Sun has the T2 library as the default thread library in Solaris 9. See question 8.) 8. Which thread library is available in the Solaris 9 OE? The T2 library of Solaris 8 Update 7 is the only library available in Solaris 9. As such, it is the default thread library in Solaris 9. The default thread library of Solaris 8 has been retired with the release of Solaris 9. 9. Can I use the alternate thread library with my existing binaries for my application? Since the T2 library uses the same API/ABI interface as the default thread library of Solaris 8, it can be used with existing application binaries also. 10. How can I use the T2 library as my default thread library for all applications on my server?
To make the T2 library the default in the Solaris 8 OE, execute the following commands. The crle -a /usr/lib/libthread.so.1 -o /usr/lib/lwp crle -64 -a /usr/lib/64/libthread.so.1 -o /usr/lib/lwp/64
For more information, please refer to the manual page of
The 11. How can you make any one application use the alternate thread library?
Generally, changing the
To include the crle -s /usr/lib/secure:/usr/lib/lwp
If the application is a 64-bit application, then the environment variable
LD_LIBRARY_PATH=/usr/lib/lwp
LD_LIBRARY_PATH_64=/usr/lib/lwp/64
The
12. What if my application binaries have
If the application contains binaries with
13. Can different processes of the same application use different thread libraries at the same time?
Yes. The T2 library was designed to work along with the default thread library in a 14. How do I relink so that the alternate thread library is always used, if available, and I still have a single set of binaries for all Solaris versions?
Relink the end binaries with   POSIX
A colon-separated list of directories is used to specify library search directories to the runtime linker. If present and not null, it is recorded in the output object file and passed to the runtime linker. If binaries are generated with This change has the following effects on different Solaris releases:
Only the final binaries have to be relinked with the 15. If I use the T2 library, do I have to retest my application? Sun recommends that the application be retested with the T2 library before using it for mission-critical production environments. 16. Is the T2 library supported on the Solaris 8 OE? Yes, the T2 library is fully supported on Solaris 8. However, it is strongly recommended that you first upgrade to Solaris 8 Update 7 to use the T2 library. 17. Where do I find more information on the T2 library for the Solaris 8 OE? For more information, please check out the following:
About the AuthorJ.K. Shah is a software engineer in the Market Development Engineering organization at Sun. He works with Sun's ISVs, helping them to adopt emerging Sun technologies. He holds a B.E. in Electronics Engineering and an M.S. in Computer Science. | ||||||||
|
| ||||||||||||