Dummy pthread functions in libc considered harmful

Rich Felker dalias@libc.org
Tue Aug 25 07:19:00 GMT 2015


On Tue, Aug 25, 2015 at 09:09:58AM +0200, Andreas Schwab wrote:
> Samuel Thibault <samuel.thibault@ens-lyon.org> writes:
> 
> > It's usually not programs which call pthread_mutex, but libraries which
> > want to be thread-safe without actually bringing the libpthread
> > dependencye.
> 
> Does the reason for avoiding the dependency still exist?  Surely the
> overhead of libpthread has been greatly reduced since the days of
> linuxthreads.

In short, no, but it's hard to get people to give up bad practices. So
glibc needs to minimize the impact of these bad choices.

Really, libpthread.so should just be an empty library file for
compatibility and all of the actual implementations should be in
libc.so, but making that happen would be a lot of work.

Rich



More information about the Libc-alpha mailing list