From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5794 invoked by alias); 26 Nov 2015 16:12:47 -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 5779 invoked by uid 89); 26 Nov 2015 16:12:47 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-pa0-f45.google.com Received: from mail-pa0-f45.google.com (HELO mail-pa0-f45.google.com) (209.85.220.45) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Thu, 26 Nov 2015 16:12:46 +0000 Received: by pabfh17 with SMTP id fh17so92731823pab.0 for ; Thu, 26 Nov 2015 08:12:44 -0800 (PST) X-Received: by 10.98.16.216 with SMTP id 85mr41278580pfq.64.1448554364230; Thu, 26 Nov 2015 08:12:44 -0800 (PST) Received: from E107787-LIN (gcc1-power7.osuosl.org. [140.211.15.137]) by smtp.gmail.com with ESMTPSA id dz6sm5195413pab.19.2015.11.26.08.12.42 (version=TLS1_2 cipher=AES128-SHA bits=128/128); Thu, 26 Nov 2015 08:12:43 -0800 (PST) From: Yao Qi To: Pedro Alves Cc: Yao Qi , gdb-patches@sourceware.org Subject: Re: [PATCH 03/18] attach + target always in non-stop mode: stop all threads References: <1444836486-25679-1-git-send-email-palves@redhat.com> <1444836486-25679-4-git-send-email-palves@redhat.com> <86r3ki0vzy.fsf@gmail.com> <565357B1.4070805@redhat.com> Date: Thu, 26 Nov 2015 16:12:00 -0000 In-Reply-To: <565357B1.4070805@redhat.com> (Pedro Alves's message of "Mon, 23 Nov 2015 18:15:13 +0000") Message-ID: <86oaegwxhk.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes X-SW-Source: 2015-11/txt/msg00569.txt.bz2 Pedro Alves writes: > It actually ends up being the same, and bit more generic to go with > lowest, because target_attach should always adds the main thread first. > Otherwise, there's no such concept of "main" thread in the common code. > "The thread with pid =3D=3D lwpid" holds true for NTPL/Linux, but not eve= rywhere, > and even then the leader thread may have exited already. I'll update > the comment. Yes, there is no such concept of "main" thread. My real concern on "choosing lowest one" is about pid recycling. Our intention is to pick up main thread, but the lowest one may not be the main thread if pid recycling is considered. --=20 Yao (=E9=BD=90=E5=B0=A7)