This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: pthread weak symbols
- From: Nikos Mavrogiannopoulos <nmav at redhat dot com>
- To: Matt Turner <mattst88 at gmail dot com>, GNU C Library <libc-alpha at sourceware dot org>
- Date: Thu, 17 Dec 2015 16:44:39 +0100
- Subject: Re: pthread weak symbols
- Authentication-results: sourceware.org; auth=none
- References: <CAEdQ38EeTtv6zty4wDAr-s=SERMOqgQMSqex7qAirj_UtZOviA at mail dot gmail dot com>
On Wed, 2015-12-09 at 15:20 -0800, Matt Turner wrote:
> I'm interested in avoiding pthread/locking overhead in Mesa
> (http://mesa3d.org/) when the application is not using threads.
>
> I've read about glibc's weak pthread symbols that are intended to
> solve this problem, but I've also read on this list that they weren't
> a good idea and have some (unknown to me) problems.
>
> Can I get some clarification about what problems there are with the
> weak pthread symbols, and perhaps some suggested alternative
> solutions?
One catch I've noticed with the pthread locking symbols in libc is that
they only work for non-recursive mutexes. If your project requires a
recursive mutex you couldn't use them.
regards,
Nikos
PS. a more detailed description at: https://bugzilla.redhat.com/show_bug.cgi?id=1241075