From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from omta038.useast.a.cloudfilter.net (omta038.useast.a.cloudfilter.net [44.202.169.37]) by sourceware.org (Postfix) with ESMTPS id A97FE3857C60 for ; Tue, 13 Feb 2024 18:04:05 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org A97FE3857C60 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=tromey.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=tromey.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org A97FE3857C60 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=44.202.169.37 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1707847450; cv=none; b=vvdkNN23P/JK5sKWRqUaAuGP7bXpn4k4Su7fnbvVDw402DC6zbnQleJGG6fTVrYxIf69r8+5Lkng76hv+F2KGshZuJNxBu+I3tpwsi6ieFgjReyKfTImKq+EhmvlMV/vUQzyAoKv9YCkcPH/nUQ/6Chi6xFGVnvI+GhJls6bw90= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1707847450; c=relaxed/simple; bh=TJF25oCumHXX/JJTN4UsYLZpUNnCL93bL6LhtT+5ZFg=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=H0i0VbnEXpQqSB00wPrYfXgOOAE3IDPj4LzWaSyBkaiBvQD3gAoDVAJiQgcnp5wmS9YwrSURhq9qVeZTblu+XzYmO1hObNcet+kr+djE37KGGruP7xIWqTRHrf2T5foWqFZgS1ShaFzR+kNp8EOcU8l4dHCu0sVffU0dkYxvp2k= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from eig-obgw-6006a.ext.cloudfilter.net ([10.0.30.182]) by cmsmtp with ESMTPS id ZsbFrfvbQ9gG6Zx8XrXw3P; Tue, 13 Feb 2024 18:04:05 +0000 Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with ESMTPS id Zx8WrcfJg5hh9Zx8WrDumA; Tue, 13 Feb 2024 18:04:04 +0000 X-Authority-Analysis: v=2.4 cv=VouAAP2n c=1 sm=1 tr=0 ts=65cbaf14 a=ApxJNpeYhEAb1aAlGBBbmA==:117 a=ApxJNpeYhEAb1aAlGBBbmA==:17 a=k7vzHIieQBIA:10 a=Qbun_eYptAEA:10 a=_pt0hDpMuSBdRULg7BEA:9 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date:References :Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=W7tpE9XYuCZyBPcd095O/LyrZlEOVi3N97b8aTyiuNA=; b=SCurud4Lhp2PRzzP6yQuf69Jcj 20dvTx7fbiZDmEGMoJ/ZNTSZFvrl9t0CgflYToLCVT1jsLJ3AQU2cOx3ecMC7aWXLqnNUeJCTxtq6 WXJN2oDhabsBrJLvDk/w/MOkP; Received: from 71-211-170-195.hlrn.qwest.net ([71.211.170.195]:54956 helo=murgatroyd) by box5379.bluehost.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96.2) (envelope-from ) id 1rZx8W-002Fbk-0D; Tue, 13 Feb 2024 11:04:04 -0700 From: Tom Tromey To: Tom de Vries Cc: Tom Tromey , gdb-patches@sourceware.org Subject: Re: [RFC 1/3] [gdb/dap] Fix exit race References: <20240207090224.27521-1-tdevries@suse.de> <20240207090224.27521-2-tdevries@suse.de> <875xz0clgw.fsf@tromey.com> <0abb6b1d-52ce-43c5-ac49-fa98ad06a810@suse.de> X-Attribution: Tom Date: Tue, 13 Feb 2024 11:04:03 -0700 In-Reply-To: <0abb6b1d-52ce-43c5-ac49-fa98ad06a810@suse.de> (Tom de Vries's message of "Tue, 13 Feb 2024 16:04:35 +0100") Message-ID: <87il2s5jho.fsf@tromey.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - box5379.bluehost.com X-AntiAbuse: Original Domain - sourceware.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - tromey.com X-BWhitelist: no X-Source-IP: 71.211.170.195 X-Source-L: No X-Exim-ID: 1rZx8W-002Fbk-0D X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: 71-211-170-195.hlrn.qwest.net (murgatroyd) [71.211.170.195]:54956 X-Source-Auth: tom+tromey.com X-Email-Count: 2 X-Org: HG=bhshared;ORG=bluehost; X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTM3OS5ibHVlaG9zdC5jb20= X-Local-Domain: yes X-CMAE-Envelope: MS4xfCFTFvBY1egi94ysp+s9F02zKIoZ4263MKfUEw2vDcezN1XyUTyr/gEEUTOHLt4izlf4k4XaS7MLdDJn4jprObcVQ3uz8m9Br0hL//Ggh5ULYR7c+oJ4 lHJ4fFsjhiAW/VmO9aKy15NZHnXOkShRgocWaA2KQBCSDxqivboVXa1VUrMZnpGrgoW6TUVCxGW3rwN0gZrrg/7TXE8UXo5JYQU= X-Spam-Status: No, score=-3015.9 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,JMQ_SPF_NEUTRAL,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE 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: >> One way to fix this would be to have start_json_writer return the >> thread >> object, and then have main_loop join the thread to terminate after >> writing the None. This would mean making this particular thread >> non-daemon though. Tom> And as I understand it, the downside of that is that it could possibly Tom> hang the gdb process. How so? Tom> + queue.task_done() I think SimpleQueue doesn't have task_done, so you have to change this code to use Queue and instead. Tom> # JSON-writing thread, so that we can ensure that all Tom> # responses are flushed to the client before exiting. Tom> self.write_queue.put(None) Tom> + self.write_queue.join() Tom> + send_gdb("quit") I suspect this isn't needed. Tom