Michael B. Jones. Bringing the C Libraries With Us into a Multi-Thread Future. [postscript] Proceedings of the 1991 Winter USENIX Conference, January 1991.

An enormous amount of UNIX (and UNIX-like) code has been written (by a likewise enormous amount of programmers) that uses the standard C libraries. Use is made throughout much of this code of the knowledge that traditional UNIX programs have exactly one thread in control. However increasing numbers of UNIX-like systems are beginning to provide support for programs with multiple threads of control. To the possible extent, it is highly desirable to preserve the existing C library interfaces for multi-threaded programs; this will aid both in code and programmer portability between traditional UNIX environments and new multi-threaded ones.

A number of issues must be confronted in order to produce versions of the C libraries which can be used in multi-threaded programming environments. Among these are: functions with non-reentrant interfaces, functions which maintain state between invocations, use of macros in the library interfaces, interactions with signals, compatibility with single-threaded library data structures, performance issues, and of course, erno. Despite these and other problems, experience has shown that reasonable solutions are available. This paper presents both a detailed explanation of the inherent problems in producing multi-thread-safe C libraries and the different solutions which are available. Finally, the solutions to these problems adopted by a number of research and industry groups are presented.