Thread-safe C libraries in Solaris?

Thread-safe C libraries in Solaris?

Post by William Hub » Sat, 08 Jan 1994 02:29:34



        I am interested in knowing if the latest release of Solaris has
thread-safe C libraries. I have heard rumors that this is the case. If
so, can anyone tell me if Sun was able to accomplish this and still
keep the interfaces to the C library routines the same? Or, were they
forced to create new interfaces for various functions which are not
thread-safe and have additional arguments in order to make them
thread-safe (as proposed in recent drafts of POSIX 1003.4a)? (For example
POSIX proposes a thread-safe version of ttyname() known as ttyname_r()
with additional arguments which supply the buffer.)
        Thanks for any information you can provide.

                                                -Bill Huber

 
 
 

Thread-safe C libraries in Solaris?

Post by Casper H.S. D » Sat, 08 Jan 1994 02:57:35



>    I am interested in knowing if the latest release of Solaris has
>thread-safe C libraries. I have heard rumors that this is the case. If
>so, can anyone tell me if Sun was able to accomplish this and still
>keep the interfaces to the C library routines the same? Or, were they
>forced to create new interfaces for various functions which are not
>thread-safe and have additional arguments in order to make them
>thread-safe (as proposed in recent drafts of POSIX 1003.4a)? (For example
>POSIX proposes a thread-safe version of ttyname() known as ttyname_r()
>with additional arguments which supply the buffer.)
>    Thanks for any information you can provide.

Thread safe C library interfaces exist.  In Solaris 2.3 almost
everything is MT-safe.  All interfaces are still available as
before. A number of extra functions was introduced (suffixed _r)
to provide extra reentrant functions, though Sun actually has
a mechanism to implement such functions w/o _t so that they can
be called from different threads at the same times.  This mechanism
is used for functions w/o any apparent reentrancy problems.

Casper