DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 
Threads

Thread-safe libraries

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:

Applications using other libraries that have not been made thread-safe must synchronize access to global data.
Next topic: System call wrappers
Previous topic: Error returns

© 2004 The SCO Group, Inc. All rights reserved.
UnixWare 7 Release 7.1.4 - 27 April 2004