[PATCH v2] Release the GIL while running a gdb command or expression

Phil Muldoon pmuldoon@redhat.com
Thu Oct 25 12:46:00 GMT 2018


On 24/10/2018 19:08, Pedro Alves wrote:

> Do we really need to rely on printing to check this?  If the
> the gdb.execute command can run some more python code, then
> we could try using a couple python mutexes for proving the
> non-main thread runs.  

I agree.

 
> So the non-main thread would wait on mutex1 which starts owned
> by the main thread.  The main thread unlocks mutex1 and blocks
> on mutex2, waiting for the non-main thread to release it.
> The non-main thread should now run, and is now the mutex1 owner.
> It now releases mutex2.  The main thread now unblocks, and the
> test succeeds.  If we don't release the GIL properly, then
> the non-main thread won't run, and the testcase times out.
> 
> Or something along those lines.

If Tom doesn't have the time to work on this, I can find some time,
but it is entirely up to Tom.

Cheers

Phil



More information about the Gdb-patches mailing list