From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=adacore.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=adacore.com Received: by mail-il1-x12d.google.com with SMTP id p15so10116774ilg.9 for ; Thu, 05 Jan 2023 07:19:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; h=mime-version:user-agent:message-id:in-reply-to:date:references :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=Hkrswr3deiNfILv3e+5raVg4bDY8vChA+gEPNNj6BVU=; b=FINferKxgB4WDbhrrH4vgtC3b1uTNOpRO42uxY3L3rYmyc322Mm2s7PgH75KLDVdr9 cKun9a4ECahM3cGDdqCwEs4qs1ZTzNyZEPLIcToVRfZSZ2BCBFZpYVe4YV77auL8QpC+ L84cynQ7utf7H57GLnaH78SPur2a684JoHqb/I/g6T12rJNND38Juy2zBJPR7n3iImlY HJSZ6vsBwQrA7FZcBBt30D8cBuamqrl9f+0glZd+dW/JvnqrJqzLmqjrd/E95Dh2pAuT i4rTS71FeT45x5ByUZhjLybfm3SPMFMniA2lxAjeBJdO1ZcVATtlOrhWVpyJuPjw1rLV iGhA== 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) From: Tom Tromey 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-Spam-Status: No, score=-5.0 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,KAM_NUMSUBJECT,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: >>>>> "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