[PATCH 0/3] Threads and BFD

Nick Clifton nickc@redhat.com
Wed Nov 1 12:26:18 GMT 2023


Hi Tom,

> gdb started using threads a while ago.  So far we've (mostly) avoided
> doing anything BFD-related off the main thread, but I would like to
> change that.

his is definitely a worthy goal.

> The first is BFD error handling.  In this series, I chose to make it
> thread-local.  This approach seemed simple and straightforward.
> Locking seemed impractical here.  Maybe moving the error into a BFD
> would work, but I didn't serious investigate that.

Nah - I am a firm believer in keeping things simple if possible.

> The second set of globals involve opening and closing BFD, and also
> the fd cache.  I went back and forth on ways to solve this.  In this
> series I let the BFD client provide lock- and unlock-functions, and
> change BFD to use these when needed.  I took this approach because it
> means that current BFD clients don't need to be changed in any way.
> (I do have a variant of this patch where BFD implements its own
> locking using a POSIX or Windows mutex; I can send that if you'd
> prefer.)

No, I prefer the approach you have posted here.

Cheers
   Nick



More information about the Binutils mailing list