HP-UX 11i September 2001 Release Notes

Programming
Libraries
Chapter 13
200
patches (C++ library and Header File patches: PHSS_21906, PHSS_21947,
PHSS_21950, PHSS_21075, and PHSS_22217 as shown at
http://www.hp.com/esy/lang/cpp/rels.html#11) are applied to the 11.0 system.
Changes to libc
Large Files Support for C++ Applications
libc has been modified to support large files for C++ applications. 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
libc support for HP CxDL Development tool has been included in the setjmp() and
longjmp() family of APIs in both 64-bit and 32-bit libc.
libdbm
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
libc uses a single lock in the malloc() routines to make them thread-safe. 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, where malloc() can allocate space from, and a lock for each arena. Threads are
distributed among the arenas. Two new environment variables are introduced:
_M_ARENA_OPTS
_M_SBA_OPTS
_M_ARENA_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