This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Backtrace library [1/3]


On Tue, Sep 11, 2012 at 4:36 PM, Lawrence Crowl <crowl@googlers.com> wrote:
> On 9/11/12, Ian Lance Taylor <iant@google.com> wrote:
>> This patch is the interface to and configury of libbacktrace.
>> I've separated these out as the parts of libbacktrace that
>> require the most review.  The interface to libbacktrace is in
>> the file backtrace.h.  This is what callers will use.  The file
>> backtrace-supported.h is also available so that programs can see
>> whether calling the backtrace library will work at all.
>
> The interface relies on global data in the library.  Wouldn't it
> be better to expose the state as an additional parameter to enable
> concurrent access by different threads?  That parameter could then
> be modeled as 'this' parameter, addressing Gaby's suggesting.

To be clear, the library does support concurrent access by different
threads.  It uses locks internally.  And it would have to use internal
locks even if I adopt your suggestion, because it would not be
reasonable to require each separate thread to independently read and
parse the debug info.

That said, it's a good idea, and I'll see if it makes sense.

Ian


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]