From owner-freebsd-hackers@freebsd.org Mon Apr 30 14:53:38 2018 Return-Path: Delivered-To: freebsd-hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 32402FAD526 for ; Mon, 30 Apr 2018 14:53:38 +0000 (UTC) (envelope-from ryao@gentoo.org) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BCC007325E for ; Mon, 30 Apr 2018 14:53:37 +0000 (UTC) (envelope-from ryao@gentoo.org) Received: from [IPv6:2600:1:f45e:b478:dd3a:c418:c4d8:a451] (unknown [IPv6:2600:1:f45e:b478:dd3a:c418:c4d8:a451]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: ryao) by smtp.gentoo.org (Postfix) with ESMTPSA id 7545B335C80; Mon, 30 Apr 2018 14:53:32 +0000 (UTC) Mime-Version: 1.0 (1.0) Subject: Re: Getting pthread names From: Richard Yao X-Mailer: iPhone Mail (15E302) In-Reply-To: <7d26b9d2-0f1e-2103-941a-c9c608b4e4fa@digitaldaemon.com> Date: Mon, 30 Apr 2018 10:53:26 -0400 Cc: =?utf-8?Q?Manuel_St=C3=BChn?= , freebsd-hackers@freebsd.org Message-Id: <64966B3E-41FE-44A5-A85D-A96EF89B22ED@gentoo.org> References: <20180430111434.GA18085@freebsd-t450.fritz.box> <7d26b9d2-0f1e-2103-941a-c9c608b4e4fa@digitaldaemon.com> To: Jan Knepper Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.25 X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Apr 2018 14:53:38 -0000 > On Apr 30, 2018, at 10:24 AM, Jan Knepper wrote: >=20 > I think the pthread_set_name_np(3) function is for debugging (reporting) p= urposes. It is. >=20 > The names show up when you use 'procstat', 'top', 'ps', etc. >=20 > If you want to give a thread a name and use that name later in code why no= t keep that internally in you thread management structures/code and use that= same name in the call to pthread_set_name_np? I cannot speak for him, but sometimes it is easier to just let the OS do stu= ff for you. That being said, if that is what he wants, it would be trivial t= o do using thread specific data: https://docs.oracle.com/cd/E19120-01/open.solaris/816-5137/tlib-40012/index.= html The GNU extension is just a special case of TSD that was implemented to aid d= ebugging as far as I can tell. It is separate from the pthreads functionalit= y for implementing this though. >=20 > ManiaC++ > Jan Knepper >=20 >=20 >=20 >> On 04/30/2018 07:14, Manuel St=C3=BChn wrote: >> Hi, >>=20 >> for setting a name for pthreads i found pthread_set_name_np(3), but for r= etrieving the name i found nothing. Is there any api like pthread_getname_np= for FreeBSD? Or is there another way to retrieve the threads name within an= application? >>=20 >> _______________________________________________ >> freebsd-hackers@freebsd.org mailing list >> https://lists.freebsd.org/mailman/listinfo/freebsd-hackers >> To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org= " >=20 > _______________________________________________ > freebsd-hackers@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/freebsd-hackers > To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org"=