From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 108904 invoked by alias); 25 Oct 2018 12:46:17 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 108577 invoked by uid 89); 25 Oct 2018 12:45:53 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE,TIME_LIMIT_EXCEEDED autolearn=unavailable version=3.3.2 spammy=Hx-languages-length:926, HTo:U*tom, H*M:99a3 X-HELO: mail-wr1-f67.google.com Received: from mail-wr1-f67.google.com (HELO mail-wr1-f67.google.com) (209.85.221.67) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 25 Oct 2018 12:45:28 +0000 Received: by mail-wr1-f67.google.com with SMTP id n5-v6so5393291wrw.12 for ; Thu, 25 Oct 2018 05:45:05 -0700 (PDT) Return-Path: Received: from ?IPv6:2a02:c7f:ae6a:ed00:4685:ff:fe66:9f4? ([2a02:c7f:ae6a:ed00:4685:ff:fe66:9f4]) by smtp.gmail.com with ESMTPSA id b8sm6151405wrx.97.2018.10.25.05.45.02 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 25 Oct 2018 05:45:02 -0700 (PDT) Subject: Re: [PATCH v2] Release the GIL while running a gdb command or expression To: Pedro Alves , Tom Tromey Cc: gdb-patches@sourceware.org References: <20181010202233.17985-1-tom@tromey.com> <6c7d1b6d-2d7a-dcaf-8d20-615bfb474af9@redhat.com> <871s8qcab9.fsf@tromey.com> <4aa9c215-9b86-40f9-37e9-d96121e80736@redhat.com> <87woqhbmh6.fsf@tromey.com> <87sh15bm71.fsf@tromey.com> <8b981b27-1e15-31d8-0342-492700468ecf@redhat.com> From: Phil Muldoon Message-ID: Date: Thu, 25 Oct 2018 12:46:00 -0000 MIME-Version: 1.0 In-Reply-To: <8b981b27-1e15-31d8-0342-492700468ecf@redhat.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2018-10/txt/msg00573.txt.bz2 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