From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 42825 invoked by alias); 12 Oct 2018 16:56:41 -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 42813 invoked by uid 89); 12 Oct 2018 16:56:41 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy= X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 12 Oct 2018 16:56:40 +0000 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 6DA80356FD; Fri, 12 Oct 2018 16:56:39 +0000 (UTC) Received: from [127.0.0.1] (ovpn04.gateway.prod.ext.ams2.redhat.com [10.39.146.4]) by smtp.corp.redhat.com (Postfix) with ESMTP id C5B376CA36; Fri, 12 Oct 2018 16:56:38 +0000 (UTC) Subject: Re: [PATCH v2] Release the GIL while running a gdb command or expression To: Tom Tromey , gdb-patches@sourceware.org References: <20181010202233.17985-1-tom@tromey.com> From: Pedro Alves Message-ID: <6c7d1b6d-2d7a-dcaf-8d20-615bfb474af9@redhat.com> Date: Fri, 12 Oct 2018 16:56:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <20181010202233.17985-1-tom@tromey.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-SW-Source: 2018-10/txt/msg00295.txt.bz2 On 10/10/2018 09:22 PM, Tom Tromey wrote: > + > +# Define a function for the thread While at it, add missing periods? > +def print_thread_hello(): > + count = 0 > + while count < 10: > + time.sleep(1) > + count += 1 > + print ("Hello ( %d )" % count) > + > +# Create a thread and continue Ditto. > +try: > + thread.start_new_thread (print_thread_hello, ()) > + gdb.execute ("continue", release_gil=True) > +except: > + try: > + _thread.start_new_thread (print_thread_hello, ()) > + gdb.execute ("continue", release_gil=True) But what I came here for, is: AFAICT, "release_gil" was not included in this version of the patch, so that shouldn't be here either. The test should be failing because of that, I believe, because GDB should be complaining that release_gil is an invalid keyword. Does the test somehow happen to still pass with that? > + except: > + print ("Error: unable to start thread") Thanks, Pedro Alves