|
|
In previous releases of the UnixWare, libraries freely used global and static data. In a multithreaded program, different sibling threads running concurrently could corrupt global or static data. Therefore, in SVR4.2MP and UnixWare 2.0, standard libraries have been made thread-safe. When an application is compiled with the -Kthread flag to cc(1), standard libraries will synchronize threads' use of global and static data. (As this synchronization has a performance cost to single-threaded applications, it is only enabled when the -Kthread flag is used.)
In addition, new, reentrant versions of some library routines have been added. The names of these routines are suffixed with _r. For example, the reentrant version of strtok (see string(3C)) is strtok_r. Multithreaded applications should use the reentrant versions of library routines.
SVR4.2MP and UnixWare 2.0 supplies thread-safe versions of the following libraries: