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

Thread-safe libraries

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:

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

© 2005 The SCO Group, Inc. All rights reserved.
SCO OpenServer Release 6.0.0 -- 02 June 2005