This is the mail archive of the
elfutils-devel@sourceware.org
mailing list for the elfutils project.
Re: [PATCH] libdw: add thread-safety to dwarf_getabbrev()
- From: Mark Wielaard <mark at klomp dot org>
- To: Florian Weimer <fw at deneb dot enyo dot de>, Jonathon Anderson <jma14 at rice dot edu>
- Cc: elfutils-devel at sourceware dot org, Srdan Milakovic <sm108 at rice dot edu>
- Date: Sat, 26 Oct 2019 14:06:40 +0200
- Subject: Re: [PATCH] libdw: add thread-safety to dwarf_getabbrev()
- References: <1565983469.1826.0@smtp.mail.rice.edu> <20190824232438.GA2622@wildebeest.org> <1566695452.979.1@smtp.mail.rice.edu> <5ba06557703ee363e19488c994cbddd92ade25be.camel@klomp.org> <1566782688.5803.0@smtp.mail.rice.edu> <ba2c453b09ddac529a3aa122402380f5d7f82b2a.camel@klomp.org> <1566826627.5246.0@smtp.mail.rice.edu> <1566877968.10901.0@smtp.mail.rice.edu> <87tv7vg4l0.fsf@mid.deneb.enyo.de>
On Sat, 2019-10-26 at 12:54 +0200, Florian Weimer wrote:
> * Jonathon Anderson:
>
> > Just finished some modifications to the patch series, git request-pull
> > output below. This rebases onto the latest master and does a little
> > diff cleaning, the major change is that I swapped out the memory
> > management to use the pthread_key_* alternative mentioned before.
>
> This use of pthread_key_* is rather unusual. In particular, there are
> only 1024 keys supported for the entire process, so it limits the
> number of Dwarf * objects that can be created by one process, even if
> it does not use any threads.
O, I didn't know that there was such a low limit on pthread_keys. That
is indeed a bit of a problem, especially with split-dwarf where
basically every CU could be its own Dwarf object (from a .dwo file).
That would easily exceed such a low limit.
I'll see if I can create a case where that is a problem. Then we can
see how to adjust things to use less pthread_keys. Is there a different
pattern we can use?
Thanks,
Mark