|
|
In previous releases of SCO OpenServer, 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 SCO OpenServer, standard libraries have been made thread-safe. When an application is compiled with the -Kthread flag to cc(CP), 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(S)) is strtok_r. Multithreaded applications should use the reentrant versions of library routines.
SVR4.2MP and SCO OpenServer supply thread-safe versions of the following libraries: