From owner-freebsd-hackers@freebsd.org Mon Apr 30 14:24:46 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 58BB5FACAC4 for ; Mon, 30 Apr 2018 14:24:46 +0000 (UTC) (envelope-from jan@digitaldaemon.com) Received: from digitaldaemon.com (digitaldaemon.com [162.217.114.50]) by mx1.freebsd.org (Postfix) with SMTP id D52096BBF1 for ; Mon, 30 Apr 2018 14:24:45 +0000 (UTC) (envelope-from jan@digitaldaemon.com) Received: (qmail 73393 invoked by uid 89); 30 Apr 2018 14:24:37 -0000 Received: from c-24-0-179-87.hsd1.nj.comcast.net (HELO iMac.local) (jan@digitaldaemon.com@24.0.179.87) by digitaldaemon.com with SMTP; 30 Apr 2018 14:24:37 -0000 Subject: Re: Getting pthread names To: =?UTF-8?Q?Manuel_St=c3=bchn?= , freebsd-hackers@freebsd.org References: <20180430111434.GA18085@freebsd-t450.fritz.box> From: Jan Knepper Message-ID: <7d26b9d2-0f1e-2103-941a-c9c608b4e4fa@digitaldaemon.com> Date: Mon, 30 Apr 2018 10:24:36 -0400 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: <20180430111434.GA18085@freebsd-t450.fritz.box> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US 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:24:46 -0000 I think the pthread_set_name_np(3) function is for debugging (reporting) purposes. The names show up when you use 'procstat', 'top', 'ps', etc. If you want to give a thread a name and use that name later in code why not keep that internally in you thread management structures/code and use that same name in the call to pthread_set_name_np? ManiaC++ Jan Knepper On 04/30/2018 07:14, Manuel Stühn wrote: > Hi, > > for setting a name for pthreads i found pthread_set_name_np(3), but > for retrieving 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? > > _______________________________________________ > 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"