From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id 6GKeE6PqtmPc+g8AWB0awg (envelope-from ) for ; Thu, 05 Jan 2023 10:20:03 -0500 Received: by simark.ca (Postfix, from userid 112) id 3A5B31E222; Thu, 5 Jan 2023 10:20:03 -0500 (EST) Authentication-Results: simark.ca; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.a=rsa-sha256 header.s=default header.b=febJLjvC; dkim-atps=neutral X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-8.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 2B3141E112 for ; Thu, 5 Jan 2023 10:20:02 -0500 (EST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 5973A3858C33 for ; Thu, 5 Jan 2023 15:20:01 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 5973A3858C33 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1672932001; bh=Hkrswr3deiNfILv3e+5raVg4bDY8vChA+gEPNNj6BVU=; h=To:Cc:Subject:References:Date:In-Reply-To:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=febJLjvCjB1esW9e5B/Yn/CDcJUd+ZHx6OoFM4M0mjWh7Xb9crjdpkKF7xPCjdkMo pDg8524HIyuGuNpdDWFh3YRPpKUvn99izoGUADRurno7XbPGtZR/sCHBCfqwRILjgL 170v5VvF2sRWtAbinGGqehZbrKNOfYEPsuk+MVy4= Received: from mail-il1-x12d.google.com (mail-il1-x12d.google.com [IPv6:2607:f8b0:4864:20::12d]) by sourceware.org (Postfix) with ESMTPS id A929C3858D28 for ; Thu, 5 Jan 2023 15:19:37 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org A929C3858D28 Received: by mail-il1-x12d.google.com with SMTP id p15so10116774ilg.9 for ; Thu, 05 Jan 2023 07:19:37 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=mime-version:user-agent:message-id:in-reply-to:date:references :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=Hkrswr3deiNfILv3e+5raVg4bDY8vChA+gEPNNj6BVU=; b=rgnJzmFxrjuRT4R+3ApDqTBY3bCE2rZYtBEwjp4it6x7ZsFFTvJVe7UmRCQkIhWMUU 0k3mYdOCMRHcORPlFOKrkSGk577bkWRFdKVbhs6oM0pjLK0xN0Uu9lpEXkLY1A3u0LOQ /6sOkFqpHRSfyCD7PkeBhuwVxP+mhkHTrUhReNaGNsdHu+3QZIybyN7dQhI5cahmCdN9 HVNU2Bnv9FjLANLZtVxHTexVR59bzKLWL+juCMQUbZws+n0ail5JuWtxaNkFVwyJ8eWR vAMrfnhAjygXmvT8HJYBH8+19/a++6DEAYv/Q6zgUc6ykXPkGIpaFx0kQIkXNUUmHg8i HjOQ== X-Gm-Message-State: AFqh2kq+zPQoDt7MOrIlMdEKgH9lP9JDK33qcYer4pmiTcEv2rs8kOLm 2OMLMU2XTAtiHHyitvIwnMInTw== X-Google-Smtp-Source: AMrXdXuoId+1stq1TxYWMAOX99kpQcztNIHtWF9AWxkHmzDTpFo0lXoiunE7vK5PLqbX5aAbHUiAwQ== X-Received: by 2002:a05:6e02:1bc4:b0:300:ed0e:30bf with SMTP id x4-20020a056e021bc400b00300ed0e30bfmr39014559ilv.14.1672931976954; Thu, 05 Jan 2023 07:19:36 -0800 (PST) Received: from murgatroyd (97-122-76-186.hlrn.qwest.net. [97.122.76.186]) by smtp.gmail.com with ESMTPSA id a91-20020a029464000000b0039dedbbb81dsm6896399jai.18.2023.01.05.07.19.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Jan 2023 07:19:36 -0800 (PST) To: Tom de Vries Cc: Tom Tromey , Tom Tromey via Gdb-patches Subject: Re: [PATCH] [gdb/python] Avoid queue.SimpleQueue for python 3.6 References: <20220901163059.3678708-1-tromey@adacore.com> <87bkrk8j21.fsf@tromey.com> <877d1duivp.fsf@tromey.com> <87k024khch.fsf@tromey.com> <5cd9edba-b1b2-060e-d8d2-98ff6d28a5e7@suse.de> <87tu17iu2j.fsf@tromey.com> <7f2d41d6-ba52-a7da-4144-a252aabd10ea@suse.de> <0b6635ea-ee55-1edd-6f4b-149a3ab200f5@suse.de> X-Attribution: Tom Date: Thu, 05 Jan 2023 08:19:35 -0700 In-Reply-To: (Tom de Vries's message of "Thu, 5 Jan 2023 10:49:05 +0100") Message-ID: <87k021f1q0.fsf@tromey.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Tom Tromey via Gdb-patches Reply-To: Tom Tromey Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" >>>>> "Tom" == Tom de Vries writes: Tom> Fixed by attached commit, any comments? Thank you for working on this. I saw your note yesterday but was too busy to address it. Tom> + if sys.version_info[0] == 3 and sys.version_info[1] <= 6: Tom> + self.write_queue = queue.Queue() Tom> + else: Tom> + self.write_queue = queue.SimpleQueue() It wasn't clear to me what happens with Queue if task_done is never called. Like, does it "leak" memory? This is why I chose SimpleQueue. Maybe we can just switch to Queue entirely and have the popping code also call task_done immediately. That seems ok since we don't use join. I guess what I would do here is have a helper module that uses SimpleQueue if it is available, and otherwise implements a look-alike using Queue. I don't know if I can work on this today but I will get to it soon, unless you feel like trying it out. If Queue can be dropped in like your patch without any negative effects, then that's also totally fine by me. Tom