This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB 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: [PATCH v2] Release the GIL while running a gdb command or expression


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


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