HP-UX 11i December 2002 Release Notes

Programming
Libraries
Chapter 15
282
Documentation
Detailed manpages for the new library are included with the Independent Software Unit
release. The new library is also discussed in aC++ Online Help.
Changes to libc
Large Files Support for C++ Applications
To support large files for C++ applications, libc has been modified. C++ applications
can now access files greater than 2 GB. This is done by setting
_FILE_OFFSET_BITS to 64 in 32-bit mode. More details can be found in the HP-UX
Large Files White Paper Version 1.4 on http://docs.hp.com.
HP CxDL Development Tool Support
In both 64-bit and 32-bit libc, support for HP CxDL Development tool has been
included in the setjmp() and longjmp() family of APIs.
libdbm and libndbm
A new patch for the dbm libraries, libdbm (1) and libndbm (2), has been created to
increase performance of dbm_nextkey().
Header Files
Header files, ftw.h and stdio.h, were patched to enable C++ large files support. In
addition, numerous defects were fixed.
New Environment Variables for malloc()
To make them thread-safe,libc uses a single lock in the malloc() routines. In a
multi-threaded application, there could be contention on this single lock if multiple
threads are calling malloc and free at the same time. This patch provides multiple
arenas (from where malloc() can allocate space) and a lock for each arena. Threads
are distributed among the arenas. Two new environment variables are introduced:
_M_ARENA_OPTS
_M_SBA_OPTS
These can be used to tune the number of arenas and the arena expansion factor for
threaded applications. In general, the more threads in an application, the more
arenas should be used for better performance. Expansion factors control the number
of pages to expand each time and assumes the page size is 4096 bytes. The number of
arenas can be from 4 to 64 for threaded applications.
For non-threaded applications, only one arena is used regardless of whether this
environment variable is set or not. However, you still can use this environment
variable to change the expansion factor for non-threaded applications.
If the environment variable is not set, or the number of arenas is set to be out of the
range, the default number of 8 is used. The expansion factor is from 1 to 4096; the
default value is 32. Again, if the factor is out of the range, the default value will be
used. For example:
$ export _M_ARENA_OPTS=8:32